-
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
Specifying private repository URL via environment variable not possible #4880
Comments
I'm interested in this! I'd like to use a private enterprise PyPI mirror (which is only accessible on a VPN) in CI, but default to using the live package index from developers local machines. |
@JnsLns can you try a version |
I have a similar issue, a repository that contains "secret" information in its url. That should not be in a file, but in environment variable. I have tried it with the current master. Unfortunately neither using |
✨ This is an old work account. Please reference @brandonchinn178 for all future communication ✨ Note: |
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. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: Debian GNU/Linux 10 (buster)
Poetry version: 1.1.8
Issue
Specifying the URL of a private repository via an environment variable does not result in a working configuration. For instance after
export POETRY_REPOSITORIES_MYREPO=https://my-repo-url/
running
poetry add some_package
results inIn contrast, it works without issues when specifying the URL via
poetry config
, such aspoetry config --local repositories.myrepo https://my-repo-url/
Meaning the repository is accessed without exceptions doing e.g.
poetry add some_package
.I have tracked down the cause to this code
https://github.com/python-poetry/poetry/blob/master/src/poetry/config/config.py#L113-L126
It seems that the code that invokes
Config.get()
expects a dictionary such as{url : "https://my-repo-url/"}
to be returned whenConfig.get()
is called withrepositories.myrepo
as argument. And that is what happens in the lower portion ofConfig.get
. That code is reached only when the env variable is not set though.When the env variable is set, the upper portion is used, which always returns a string (
'https://my-repo-url/'
in this case), leading to the exception.The text was updated successfully, but these errors were encountered: