You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When installing/downloading packages with the new resolver, and if using --extra-index-url, packages are always downloaded from the url given by the extra index if possible, regardless of their availability in the base index (pypi.org by default).
(Note that I am only testing with 1 extra index)
Expected behavior
If a package is available in the base index, it is downloaded from there.
The extra index is only used if the package is not available in the base index.
I believe this is the behavior of the legacy resolver.
How to Reproduce
Have a PyPI mirror available.
Download a package present in both indexes with the new resolver.
The package is downloaded from the url given by the extra index.
Download the same package with the legacy resolver.
The package is downloaded from the url given by the pypi.org index.
Output
I'll take numpy==1.19.5 as a random example of package to download.
That's not true, considering the behavior of the legacy resolver does behave as I described, per my output. #3454 describes an issue where the extra index is used first (with the legacy resolver) because the it uses the highest version of either index. When there is no version mismatch, my description seems correct.
I do understand that the behavior I want is described in #6045 though.
Pip treats all indexes equally, and which index is used to retrieve a package is arbitrary. So the behaviour you are seeing is as expected. Note that every copy of numpy 1.19.5 should be equivalent, so it should be irrelevant which index is used. If the copies are not equivalent, they should have different version numbers.
If you want indexes to be ordered, or otherwise don't want the "all indexes are equivalent" behaviour pip provides, you can use @uranusjr's tool simpleindex as noted in the linked issue.
Environment
Description
When installing/downloading packages with the new resolver, and if using
--extra-index-url
, packages are always downloaded from the url given by the extra index if possible, regardless of their availability in the base index (pypi.org by default).(Note that I am only testing with 1 extra index)
I did not see anything mentioning this in the "Changes to the pip dependency resolver in 20.3 (2020)" section of the user guide or in the changelog, so I think this is a regression.
Expected behavior
If a package is available in the base index, it is downloaded from there.
The extra index is only used if the package is not available in the base index.
I believe this is the behavior of the legacy resolver.
How to Reproduce
Output
I'll take
numpy==1.19.5
as a random example of package to download.The text was updated successfully, but these errors were encountered: