-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Poetry config not using token correctly when reading from private PyPI #4803
Comments
Hi Chris, I think you just need to make a couple of tweaks to your config:
Putting these together, the following command should work:
|
Thank you, @adsultana! This all stemmed from my misunderstanding of the term "repository". In my head, it was the code repository (the individual package; analogous to a GitHub repository), rather than the package repository (the repository holding many private packages). Changing |
What do I need to do if I wanted to make this private repo to become my primary source (equivalent to Also, can I completely omit the
Otherwise, I can't commit it. |
To sum up:
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
-vvv
option).Issue
I'm trying to install a library from a private PyPI, and I followed all the documented steps for setting my token using the following (Note that the token must be in quotes because it contains non-alphanumeric characters (e.g.
*
):poetry config pypi-token.pypi "<token>"
I supplied this in my
pyproject.toml
:When I try to add a library from that repository, it fails with a 401 authorization error. However, it seems to start reading from the private PyPI before failing because it successfully fetched the latest version number and started "resolving dependencies" before failing. This false start only happens sometimes, though, and if I rerun the
poetry add
command, it fails straight away with theRepositoryError
.I am sure the token is correct because the
poetry add
command does work when I supply this as mypyproject.toml
instead:This is not a viable long-term solution because if I include my raw token in the toml file, I cannot commit it.
For further context, I have also tried the following, all of which gave me the same error when running the
poetry add
command:poetry config http-basic.pypi "read" "<token>"
poetry config repositories.pypi "https://pypi.<redacted-org-name>.com/simple
poetry config repositories.pypi "https://read:<token>@pypi.<redacted-org-name>.com/simple"
auth.toml
file manually (as suggested in Does not store repository credentials #4685)export POETRY_PYPI_TOKEN_PYPI="<token>"
,export POETRY_HTTP_BASIC_PYPI_USERNAME="read"
, andexport POETRY_HTTP_BASIC_PYPI_PASSWORD="<token>"
I'd appreciate any help here, since I have exhausted all the existing documentation I could find. Thanks!
The text was updated successfully, but these errors were encountered: