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

Feature: Allow to "All Except ...." for --only/--no-binary. #12362

Closed
wants to merge 1 commit into from

Conversation

Carreau
Copy link
Contributor

@Carreau Carreau commented Oct 16, 2023

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)

This is an attempt to fix pypa#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)
@Carreau Carreau closed this Sep 16, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to use --only-binary=:all: but exclude a few packages.
1 participant