Skip to content

Feature: Specify constraints file for the isolated build environment #13300

Open
@andy-maier

Description

@andy-maier

What's the problem this feature will solve?

The recent hickup with setuptools 78.0.1 has shown:

  • A constraints file specified with the -c option of pip does not affect its isolated build environment
  • A constraints file specified with the PIP_CONSTRAINT env var does influence its isolated build environment

See pypa/setuptools#4910 (comment) for details.

That difference is inconsistent and the documentation also does not reveal the difference nor does it even talk about the isolated build environment: https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-c

Describe the solution you'd like

Add a command line option and corresponding env var that allows specifying a constraints file for only the isolated build environment whenever pip builds a package, e.g. when installing from a tarball.

The "uv" installer does have a UV_BUILD_CONSTRAINT env var and --build-constraint option specifically for constraints on the isolated build environment.

Alternative Solutions

  • Use "uv pip install" :-)
  • Continue with the different behavior mentioned above (bad)

Additional context

May be related to #8439

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