-
Notifications
You must be signed in to change notification settings - Fork 124
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
Allow setting build env constraints #292
Comments
This is out of scope IMO. This package aims to be simple, as it is crucial for bootstraping Python environments, so I'd like to avoid bringing much complexity into it. It is a hard line to draw, and this use-case does not seem strong enough. We already provide all the CLI, or API, required for making this work, so not having the glue directly available in the project should not be an issue. You can acheive the same with the following commands.
|
The idea here is to avoid using constraints as requirements, because they are not that, though. |
I feel like this should be discussed at the PEP level, not the tool level. Currently, PEP-518/517 does not handle your request. |
I think I don't really understand this comment. Could you clarify? |
Are you able to pass constraints in an env var? Does that work with pip? |
Yes I think setting |
Woah, I haven't thought about this. I guess having such a workaround would be useful. Although, for
I meant that I'd like to pass |
So while reflecting on this, I now have a slightly different feature idea for build. Would it be possible to have a command for extracting the list of the build deps from toml? The idea is that if there's something like |
The issue with that is that it might be incomplete if the backend defines extra dependencies in get_requires_for_build_sdist and you can’t call the hook without having previously installed the pyproject.toml dependencies.
Sent with [ProtonMail](https://protonmail.com) Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
…On Tuesday, 11 May 2021 01:32, Sviatoslav Sydorenko ***@***.***> wrote:
So while reflecting on this, I now have a slightly different feature idea for build.
Would it be possible to have a command for extracting the list of the build deps from toml? The idea is that if there's something like build --export-sdist-build-deps-to=build-requirements.txt, this would facilitate the manual build env provisioning process w/o having to have an additional to build config parsing implementation.
—
You are receiving this because you were mentioned.
Reply to this email directly, [view it on GitHub](#292 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AHNRFWHVA2GYOYYVCDXEZD3TNBNIDANCNFSM44LTSMAA).
|
I've recently verified that setting |
This change adds pinned constraints to the PEP 517 based distribution package build process by adding a pip-tools managed lock file. It is also auto-updatable by GitHub Dependabot.
So long as the envvar passes all the way through to the actual build environment when the build deps are installed, that's probably good enough for now, but yeah, agreed that this is a common problem that we've been nailed on numerous times, and just manually syncing the requirements is a lot more problematic than constraining known problem cases. It seems like this is already a problem that every backend needs to solve, so long-term, having a common way to do it would be a Good Thing. |
I don't see a future where build allows you to constrain your build deps the way it's set up currently - that sounds like the job of a locker/env manager, which build is not. If build had a more pluggable architecture and you could write 'drivers' for pip/Poetry/pdm/pip-lock/who knows what, then it could make sense. But I can't imagine who's gonna make that happen or if build is the place where it should happen. |
I think that the locker thing is separate, yes. I use pip-tools to produce the constraints file. But what is the problem with making pip consume it? It's already being called under the hood anyway. |
I'd like to add a +1 to this feature request.
There are a couple of use-cases.
The solution above, using PIP_CONSTRAINTS is really working around the absence of this feature by reaching into the internals of pypa/build and configuring its I'd like to propose a command line option, like-
Which could be routed through to the I understand that the maintainers here want to keep the tool small, but given that |
Reasons to do this: - setuptools is no longer the only game in town. When cibuildwheel was created, setuptools was the only way to make wheels. these days, there are many build backends so special casing setuptools doesn't make so much sense - we don't need to preinstall `wheel` any more, setuptools will do that itself when it needs it. - projects with pyproject.toml (i.e. the vast majority of projects going forward) don't benefit from the pin anyway, because both `pip` and `build` create an isolated environment to install `build-system.requires` into. - this makes it easier for end users (such as @webknjaz) to control build-system versions using `PIP_CONSTRAINT`, because there's less potential for a user-specified version to conflict with one of our pins. - (long-term, I'd love `build` to [support this directly](pypa/build#292), and then we could have a proper way to keep pyproject.toml dependencies loose and forward-compatible while retaining build determinism. But PIP_CONSTRAINT is the best we have for now. PIP_CONSTRAINT isn't ideal because it affects other things, like the test virtualenv). This PR also adds a pin for pypa/build. It appears that was missing before, but we should pin it.
So normally folks put direct unrestricted dependencies into their
requires
under[build-system]
inpyproject.toml
. This means that building the same dist may become unpredictable over time. One way to solve this is to somehow generate a dependency tree with all transitive deps pinned and stick it there.But this approach seems weird. Do you think it'd be reasonable to have something like
python -m build ... --constraints=build-env-deps.txt
pointing to constraints for use inpip install
command?The text was updated successfully, but these errors were encountered: