-
Notifications
You must be signed in to change notification settings - Fork 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
Different behavior when --extra-index-url is specified in the command line and requirements file #8640
Comments
I’ve modified the title to describe the underlying issue instead of the result. This would be more indicative for contributors when they browse the tracker. Issues that only affect one package are usually of low priority. |
Thank you @uranusjr, the new title is indeed a better description of the underlying issue. |
@NoahGorny, I now discovered your pull request #8522 and it turns out to fix this issue. Would you be able to proceed with that PR? |
I think this has been fixed? |
Environment
Description
--extra-index-url
option is treated slightly differently when specified in command line and when included in a requirements file. This prevents normal usage of artifacts-keyring on Windows.requirements.txt:
(A) --extra-index-url in requirements.txt
pip asks for username/password instead of retrieving credentials from keyring.
(B) --extra-index-url in command line
Expected behavior
Both of the commands above should produce the same result (installation of the package without pip prompting for credentials).
Preliminary analysis
The different behavior seems to be caused by not passing all index_urls to
MultiDomainBasicAuth
in the first case:(A) --extra-index-url in requirements.txt
MultiDomainBasicAuth(index_urls=['https://pypi.org/simple'])
(B) --extra-index-url in command line
MultiDomainBasicAuth(index_urls=['https://pypi.org/simple', 'https://myorg.pkgs.visualstudio.com/myproject/_packaging/myfeed/pypi/simple'])
In case (A) this prevents
MultiDomainBasicAuth._get_index_url()
from retrieving the correct index_url for a given package url. Eventually, keyring is queried with"myorg.pkgs.visualstudio.com"
instead of"https://myorg.pkgs.visualstudio.com/myproject/_packaging/myfeed/pypi/simple"
, which it doesn't support.The text was updated successfully, but these errors were encountered: