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:
parent
d38cead031
commit
0f03a05207
|
@ -473,12 +473,14 @@ class CandidateEvaluator(object):
|
||||||
c for c in candidates if str(c.version) in versions
|
c for c in candidates if str(c.version) in versions
|
||||||
]
|
]
|
||||||
|
|
||||||
return filter_unallowed_hashes(
|
filtered_applicable_candidates = filter_unallowed_hashes(
|
||||||
candidates=applicable_candidates,
|
candidates=applicable_candidates,
|
||||||
hashes=self._hashes,
|
hashes=self._hashes,
|
||||||
project_name=self._project_name,
|
project_name=self._project_name,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
return sorted(filtered_applicable_candidates, key=self._sort_key)
|
||||||
|
|
||||||
def _sort_key(self, candidate):
|
def _sort_key(self, candidate):
|
||||||
# type: (InstallationCandidate) -> CandidateSortingKey
|
# type: (InstallationCandidate) -> CandidateSortingKey
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue