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
1 changed files with 3 additions and 1 deletions

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
"""