Skip to content

Allow --no-binary and --only-binary per index #11071

@f3flight

Description

@f3flight

What's the problem this feature will solve?

In our environment we prefer to consume only source artifacts from the outside world, but not binaries (for ex. wheels). Currently we have to do funky stuff like pip download --no-binary :all: ... + some code to replace downloaded sdists with internally available wheels if version matches + we have a problem with build dependencies and setup dependencies.

Describe the solution you'd like

Add support for a new token :index:<http...> in --no-binary and --only-binary handlers. <http...> is a URL which will be compared against Link.comes_from in LinkEvaluator (where most other binary vs source logic is also located).

Example use case:

pip install blah --extra-index-url https://my-trusted-wheels-source.local --no-binary ":index:https://pypi.org"

Result:

  • all wheels found on pypi.org are skipped.
  • wheels on my-trusted-wheels-source.local are not skipped.

Alternative Solutions

Our team was not able to find a reliable workaround for this scenario.

Additional context

N/A

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions