Skip to content
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

give priority to --find-links order when the same version is found in multiple links #928

Closed
hugolien opened this issue May 3, 2013 · 2 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@hugolien
Copy link

hugolien commented May 3, 2013

When the same version of a requirement is found in multiple find-links, the reverse lexicographic order is applied.

So no matter if the parameters are:

--find-links ~/release --find-links ~/snapshot

or

--find-links ~/snapshot --find-links ~/release 

the version in the snapshot directory will always be used.

Preserving explicit ordering of --find-links would allow specifying a release directory in front so that is always preferred over next links.
This allows promoting a version to the 'release' directory without caring if an automated build accidentally replaces the snapshot version.

I think I found at least one place at https://github.com/pypa/pip/blob/develop/pip/index.py#L226 where the present code:

        if file_versions:
            file_versions.sort(reverse=True)

could be something like:

        if file_versions:
            file_versions.sort(reverse=True, key=operator.itemgetter(0))
@pfmoore
Copy link
Member

pfmoore commented Nov 4, 2015

This shouldn't matter. If two files have the same name and version, they should be equivalent. If they aren't, that's a problem with the files.

In your case, the snapshots should have different version numbers from the release version. If that's not what you're doing, you're not conforming to the semantics of Python package version numbers.

@xavfernandez
Copy link
Member

Agreed, if both files have the same version, the location should be irrelevant.

In your case, the snapshots should have different version numbers from the release version. If that's not what you're doing, you're not conforming to the semantics of Python package version numbers.

+1

Closing as "won't fix".

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

3 participants