Feature: Allow to "All Except ...." for --only/--no-binary. #12362
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt to fix #12348,
This allow to negate a package when using --only-binary, or --no-binary in addition to using
:all:
by prefixing the package with a~
.As noted in the issue this is not a perfect solution as we likely should maybe rethink the API, but I was hoping to achieve something useful and minimally invasive – at least to see what it entails.
With this patch doing:
pip install --only-binary=:all:,~foo --no-binary=bar qux
Will try to install all dependencies from wheels except:
- bar will installed only from tgz
- foo either tgz or sdist.
At minimum, I think we can refactor FormatControl a bit to not expose the internal implementation details, which I did with 2 class methods and update to cmdoptions.py (I'm happy to pull that into a separate refactor commit/PR if you wish)