Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Float wheels to the top of the candidate sort order #4242

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/4231.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug which caused pipenv to prefer source distributions over wheels from ``PyPI`` during the dependency resolution phase.
2 changes: 1 addition & 1 deletion pipenv/patched/notpip/_internal/index/package_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ def _sort_key(self, candidate, ignore_compatibility=True):
)
if self._prefer_binary:
binary_preference = 1
tags = self.valid_tags if not ignore_compatibility else None
tags = valid_tags
try:
pri = -(wheel.support_index_min(tags=tags))
except TypeError:
Expand Down
4 changes: 2 additions & 2 deletions tasks/vendoring/patches/patched/pip20.patch
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ index 02a187c8..f917e645 100644
modifying_pip=modifying_pip
)
diff --git a/pipenv/patched/pip/_internal/index/package_finder.py b/pipenv/patched/pip/_internal/index/package_finder.py
index a74d78db..11128f4d 100644
index a74d78db..7c9dc1be 100644
--- a/pipenv/patched/pip/_internal/index/package_finder.py
+++ b/pipenv/patched/pip/_internal/index/package_finder.py
@@ -121,6 +121,7 @@ class LinkEvaluator(object):
Expand Down Expand Up @@ -201,7 +201,7 @@ index a74d78db..11128f4d 100644
if self._prefer_binary:
binary_preference = 1
- pri = -(wheel.support_index_min(valid_tags))
+ tags = self.valid_tags if not ignore_compatibility else None
+ tags = valid_tags
+ try:
+ pri = -(wheel.support_index_min(tags=tags))
+ except TypeError:
Expand Down