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

Make --prefer-binary the default behavior for pip install #11214

Closed
1 task done
geoffreyblake opened this issue Jun 28, 2022 · 4 comments
Closed
1 task done

Make --prefer-binary the default behavior for pip install #11214

geoffreyblake opened this issue Jun 28, 2022 · 4 comments
Labels
kind: backwards incompatible Would be backward incompatible type: feature request Request for a new feature

Comments

@geoffreyblake
Copy link

geoffreyblake commented Jun 28, 2022

What's the problem this feature will solve?

Pip wheels with binary components are fast and easy to install and generally work out-of-the box vs downloading the source code and trying to build the wheel on the installing machine which may lack the toolchains needed (for some wheels they need more than a python-devel pkg and gcc). Pip currently prefers the latest packages even if it has to attempt building it.

Describe the solution you'd like

I'd like to see pip prefer downloading a binary wheel over source, so making --prefer-binary the default behavior instead of an optional flag.

Alternative Solutions

Using --prefer-binary on the command line works.

Additional context

Many wheels are built and released automatically by CI tool-chains and will do partial releases, this is a problem for some platforms like arm64 that will see wheels missing for some versions and then get fixed in a later release. Using a default --prefer-binary would skip a partial release instead of failing an install.

Code of Conduct

@geoffreyblake geoffreyblake added S: needs triage Issues/PRs that need to be triaged type: feature request Request for a new feature labels Jun 28, 2022
@pradyunsg
Copy link
Member

Hi, thanks for filing this suggestion.

While I do understand where you might be coming from, there's various reasons that changing the default to --prefer-binary is a non-trivial task that I don't think we'd be doing. The main one is that it's a somewhat disruptive backwards incompatible change -- there's definitely build pipelines that depend on this behavior, to function correctly. There are users who'd prefer the current behaviour of building a newer version of the package, since they have the relevant build infrastructure set up for it.

Many wheels are built and released automatically by CI tool-chains and will do partial releases, this is a problem for some platforms like arm64 that will see wheels missing for some versions and then get fixed in a later release. Using a default --prefer-binary would skip a partial release instead of failing an install.

This is better solved with staged releases on PyPI, something that's actually getting a bunch of volunteer effort put toward it right now -- pypi/warehouse#726 (comment)

@pradyunsg pradyunsg added kind: backwards incompatible Would be backward incompatible and removed S: needs triage Issues/PRs that need to be triaged labels Jun 28, 2022
@uranusjr
Copy link
Member

Isn’t this basically #9140? That thread contains a lot more context and many proposals, including the one mentioned here.

@pfmoore
Copy link
Member

pfmoore commented Jun 30, 2022

Isn’t this basically #9140?

Yes, so I'm going to close this to centralise discussion on that issue.

@pfmoore pfmoore closed this as completed Jun 30, 2022
@geoffreyblake
Copy link
Author

Thanks, will instead watch those 2 issues more closely.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: backwards incompatible Would be backward incompatible type: feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

4 participants