Skip to content

Commit

Permalink
issue pypa#3622 Find archives by archive-extension for fix wrong calc…
Browse files Browse the repository at this point in the history
…ulate hash if package is available in multiple formats.
  • Loading branch information
robin0371 committed Apr 30, 2016
1 parent 35edeb3 commit 72cbe8b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pip/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,14 @@ def find_requirement(self, req, upgrade):
c for c in all_candidates if str(c.version) in compatible_versions
]

archive_extension = req.options.get('archive-extension')
# If identified archive-extension, select only this extension packages
if archive_extension:
applicable_candidates = [
candidate for candidate in applicable_candidates
if candidate.location.ext.endswith(archive_extension)
]

if applicable_candidates:
best_candidate = max(applicable_candidates,
key=self._candidate_sort_key)
Expand Down

0 comments on commit 72cbe8b

Please sign in to comment.