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

Add constraints (and overrides?) to build environments #5561

Closed
charliermarsh opened this issue Jul 29, 2024 · 6 comments · Fixed by #5639
Closed

Add constraints (and overrides?) to build environments #5561

charliermarsh opened this issue Jul 29, 2024 · 6 comments · Fixed by #5639
Labels
compatibility Compatibility with a specification or another tool help wanted Contribution especially encouraged

Comments

@charliermarsh
Copy link
Member

charliermarsh commented Jul 29, 2024

We should add a --build-constraints that apply to the build environments.

See: #5551 (comment)

@charliermarsh charliermarsh added the compatibility Compatibility with a specification or another tool label Jul 29, 2024
@hauntsaninja
Copy link
Contributor

(Note that pip's behaviour is a little weird, only the env var affects the build environments, not the command line flag)

@charliermarsh
Copy link
Member Author

Oh wow, that's interesting. I'm considering providing separate API for this (like --build-constraints).

@charliermarsh charliermarsh added the help wanted Contribution especially encouraged label Jul 29, 2024
@orsinium
Copy link

In DepHell, I used to use ensurepip with fallbacks to bootstrap build venvs. It uses the setuptools and pip versions bundled with stdlib that are always the same and guaranteed to be stable.

@grant-zietsman
Copy link

grant-zietsman commented Sep 1, 2024

@charliermarsh Are there any plans to make --build-constraints a project setting (similar to constraint-dependencies)?

Currently build constraints need to be manually specified:

  • --build-constraint (seems exclusive to the pip interface).
  • UV_BUILD_CONSTRAINT (seems global).

Having a central project setting would be convenient (at least for the use case I have in mind).

Use Case (Context)

The goal is for packages (source distributions) that include protobufs to support compiling these protobufs during build while being constrained to the same major version of protobuf as required by the project into which they are being installed.

Constraining the version of protobuf both during build and via constraint-dependencies (in the end project) should ensure compatibility, if these packages (source distributions) compile protobufs with grpcio-tools during build.

This should also be attainable with no-build-isolation and no-build-isolation-package but it would be preferred to retain build isolation (to avoid unnecessarily constraining any other build requirements).

A workaround that somewhat side steps this is to compile protobufs on import.

@charliermarsh
Copy link
Member Author

Yeah we should add this. I'll make a separate issue.

@charliermarsh
Copy link
Member Author

Tracking here: #6913

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with a specification or another tool help wanted Contribution especially encouraged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants