1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Sort applicable candidates before computing best candidate

This commit is contained in:
Pradyun Gedam 2019-11-10 14:00:59 +05:30
parent d38cead031
commit 0f03a05207
No known key found for this signature in database
GPG key ID: DA17C4B29CB32E4B

View file

@ -473,12 +473,14 @@ class CandidateEvaluator(object):
c for c in candidates if str(c.version) in versions
]
return filter_unallowed_hashes(
filtered_applicable_candidates = filter_unallowed_hashes(
candidates=applicable_candidates,
hashes=self._hashes,
project_name=self._project_name,
)
return sorted(filtered_applicable_candidates, key=self._sort_key)
def _sort_key(self, candidate):
# type: (InstallationCandidate) -> CandidateSortingKey
"""