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

Can I constraint build requirements with uv build? #7082

Closed
notatallshaw opened this issue Sep 5, 2024 · 1 comment · Fixed by #7085
Closed

Can I constraint build requirements with uv build? #7082

notatallshaw opened this issue Sep 5, 2024 · 1 comment · Fixed by #7085
Assignees
Labels
enhancement New feature or improvement to existing functionality

Comments

@notatallshaw
Copy link
Contributor

I tried using the new uv build with a pyproject.toml that looks like this:

[build-system]
requires = ["setuptools==74.1.1", "wheel==0.44.0"]
build-backend = "setuptools.build_meta"

[project]
name = "minimal_project"
version = "0.1.0"

I created a build-constraints.txt file that looks like this (the versions contradict the build requires and hashes are purposefully wrong):

setuptools==69.0.0 --hash=sha256:fc91b5f89e392ef5b77fe143b17e32f65d3024744fba66dc3afe07201684d766
wheel==0.40.0 --hash=sha256:2376a90c98cc337d18623527a97c31797bd02bad0033d41547043a1cbfbe4481

I then set UV_BUILD_CONSTRAINT to point to my build-constraints.txt, and then I ran uv build ., but I did not get an error that these versions or hashes are wrong.

Is there a way to constrain build requirements during building? I specifically think of scenarios where I don't control the contents of an sdist, or there are recursive build requirements I want to constrain.

@charliermarsh
Copy link
Member

It's not supported yet but I'll probably do it today. I think it's covered in #7065.

@charliermarsh charliermarsh self-assigned this Sep 5, 2024
@charliermarsh charliermarsh added the enhancement New feature or improvement to existing functionality label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants