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

Allow to use --only-binary=:all: but exclude a few packages. #12348

Open
1 task done
Carreau opened this issue Oct 13, 2023 · 4 comments
Open
1 task done

Allow to use --only-binary=:all: but exclude a few packages. #12348

Carreau opened this issue Oct 13, 2023 · 4 comments
Labels
type: feature request Request for a new feature

Comments

@Carreau
Copy link
Contributor

Carreau commented Oct 13, 2023

What's the problem this feature will solve?

I like to have --only-binaries=:all:, especially in CI, but not all packages are availlable as binary everywhere (especially since 3.12 is recent).

I'd like to say "all binary, except for X, Y, Z". doing --only-binaries=:all: --no-binary=X,Y,Z does not cut it as now on older Python where binary is available it will still use the TGZ.

Describe the solution you'd like

Either a flag --binary-or-source=X,Y,Z, or a syntax to say --only-binary=:all:,-X,-Y,-Z

Note that this is different from --prefer-binary.

Alternative Solutions

  • List all packages instead of :all:.

It is impractical because of the potential CLI length, and recursive dependencies that may change.

  • Ask upstream to publish wheels (not always possible)
  • Install in several steps with combinaison of flags (not always possible).

Additional context

I believe that should not be too invasive of a change as most changes should be on the FormatControl class if my understanding is correct.

Code of Conduct

@Carreau Carreau added S: needs triage Issues/PRs that need to be triaged type: feature request Request for a new feature labels Oct 13, 2023
@pfmoore
Copy link
Member

pfmoore commented Oct 13, 2023

I have hit similar issues, so I'm in favour of the idea in principle. However, I think our options in this area are already rather complex and confusing (the differences and interactions between --only-binary, --prefer-binary, and --no-binary are far from obvious). I think we should be cautious about simply adding new options here, and maybe instead we should work out some form of replacement syntax that allows the user to describe clearly what they want.

I'm conscious though that "the perfect is the enemy of the good" and "practicality beats purity", so I don't want to get side-tracked designing some sort of selection language rather than just fixing the issue - but I do think we should at least consider a more general mechanism, rather than just adding more technical debt.

Also relevant here is the discussion in #9140.

@Carreau
Copy link
Contributor Author

Carreau commented Oct 13, 2023 via email

@zerothi
Copy link

zerothi commented Aug 7, 2024

This would be great!!!

I also kind of like:

pip install --only-binary=':all:,^package'

to exclude package from the :all: set. I think having the - check is not clear enough... Could be wrong here on the popular opinion.

@alexlancaster
Copy link

What's the problem this feature will solve?

I like to have --only-binaries=:all:, especially in CI, but not all packages are availlable as binary everywhere (especially since 3.12 is recent).

I'd like to say "all binary, except for X, Y, Z". doing --only-binaries=:all: --no-binary=X,Y,Z does not cut it as now on older Python where binary is available it will still use the TGZ.

hi there, I just filed #13077, because, at least for me using the --only-binary=:all: --no-binary=docopt approach does seem to work for me OK (I want to exclude docopt), from the command-line, but it doesn't work for the environment variable equivalents (PIP_ONLY_BINARY / PIP_NO_BINARY). Does this not work for you even for the command-line version?

Irrespective of the current behaviour, I agree with the other suggestions here for a more intuitive way to do this would be good, especially because of the cibuildwheel case, where we really want to ensure that the only wheels that are built, are ones that do not need compilation by the end user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request Request for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants