-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Added --prefer-binary flag. #5370
Added --prefer-binary flag. #5370
Conversation
The flag makes pip prefer an old but valid binary over a newer source package. Fixes #3785.
In principle I like this idea (in some cases, compilation isn't merely cumbersome, it's simply not possible, due to for example lack of a compiler but there's no way for pip to know that in advance). I'd like some tests to be added, to clearly define the expected behaviour. Also, I'm a little concerned about the proliferation of flags here. It might be better to think about the UX across all the options in this area rather than just adding another flag - but that's something we could look at later if needed. |
I added 3 tests which should illustrate the needed behaviour and how it differs from regular and About the UX issues - the only thing I can come up with to save a flag is Thanks |
Agreed, we shouldn't block this on broader questions - I mostly just wanted to add the comment here as a reminder for later. |
tests/functional/test_download.py
Outdated
'--prefer-binary', | ||
'--no-index', | ||
'-f', data.packages, | ||
'-d', '.', 'source>=0.9' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make this "> 0.9"?
Is there some reason the test failed on Windows but not on Unix? |
So, it turns out that on windows only, scripttest runs the command with I'll try to fix it soon (Maybe I'll just use a requirements file instead of a cli param) |
Fixed :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
If you could update the NEWS fragment, that would be nice (not a blocker). :)
news/3785.feature
Outdated
@@ -0,0 +1 @@ | |||
Add the --prefer-binary flag, to prefer older wheels over newer source packages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduce a new --prefer-binary flag, to prefer older wheels over newer source packages.
So, can this be merged? (Changed the news fragment) |
Yes. |
Would it be possible to have a new version of pip released with (at least) this feature? This is a nice improvement and would be helpful for a lot of people out there. |
pip 18.0 is due for release this month. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi,
I ran into #3785, and I need this feature, because c/cpp compilation is cumbersome, so if there is a wheel, even an old one (but still valid for the requirements), i'd rather use it than attempt to compile the source package. I can't use
--only-binary :all:
, because then python-only package that provide only source distribution won't be installed.This PR adds the needed feature.
Thanks.
Fixes #3785