diff --git a/pip/index.py b/pip/index.py index cae4c2d03da..9f15d2fbb1e 100644 --- a/pip/index.py +++ b/pip/index.py @@ -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)