-
Notifications
You must be signed in to change notification settings - Fork 751
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
Feature request: add a way to install only build dependencies #1516
Comments
May I suggest making the use case/motivation more detailed? You're jumping to the proposed solution here but it's not clear why you need this. Are you trying to have a manually managed PEP 517 build environment? An example would be helpful FTR. |
Like I wrote above, it's useful for a developer setup or CI where the need is to install dependencies without compiling the project. Think of the case, e.g., where you want to prepare a new environment for repeated builds, using no-build-isolation. |
Okay, so it's indeed about PEP 517 / 660. I wasn't sure that it's not about PEP 735. |
PEP 735: "This is suitable for creating named groups of dependencies, similar to requirements.txt files." — since we currently use |
Well, that's what I'm trying to determine by asking to spell out the use case details. It could be viewed as related but it doesn't directly cover Though you raise a valid question — can the PEP 517 build deps be a special-cased dependency group. And if you ask me, I'd say: "It's complicated". Still, it might be useful to let the PEP author know so that it could be called out in the document. |
@stefanv I've seen you linked scikit-image as an example, could you walk me through what the workflow there (or in another shareable repo) is? I'm trying to follow along what the need here workflow-wise is so we can add something to uv that fills that gap. I'm also inviting others to share their usage scenarios and pipelines, this would be extremely helpful for us for coming up with the right design and test case. |
In my last year's rant I enumerated some of the dependency groups that may exist in various workflows: jazzband/pip-tools#1326 (comment). Might be useful FTR. |
Sure thing. We have a pyproject.toml file that declares build and other types of dependencies. When then have a pre-commit hook that ensures that For simplicity, we declare all dependencies as optional package dependencies (including re-declaring build dependencies), but ideally there would be no duplication. The above configuration allows us to:
Another scenario where this is useful is for developing, say, NumPy. I want to create an environment, install all build dependencies, and then run the standard "in-place" developer build: Developer builds require that the environment already has dependencies installed. The only existing way I know of to get those dependencies installed is to install the package using "no build isolation", and to then uninstall it again. |
Looking into https://github.com/scikit-image/scikit-image/blob/628adaa/tools/generate_requirements.py#L32-L34, it seems like you don't really want build deps in the terms of PEP 517 but runtime deps that happen to be needed too. and the contents of FWIW we also have something similar for the runtime deps: https://github.com/aio-libs/aiohttp/blob/6c3122f/Makefile#L187-L190 / https://github.com/aio-libs/aiohttp/blob/6c3122f/requirements/sync-direct-runtime-deps.py / https://github.com/aio-libs/aiohttp/blob/6c3122f/requirements/runtime-deps.in. While keeping all the "dependency groups" in separate requirements files that are then processed by pip-compile to produce constraints. In another project with a focus on maximum CI stability, I do indeed retrieve |
Both use-cases are important to us. See |
@stefanv ah, I didn't realize that you maintain the entries in two places in sync. FWIW I recommended to document that this is explicitly out of the scope in PEP 735. I also noted that extending the build deps with the dependency group entries is something the build backends should eventually be able to implement eventually, making it a backend problem rather than frontend: https://discuss.python.org/t/pep-735-dependency-groups-in-pyproject-toml/39233/241. With that, you'd be able to keep the entries in dependency groups as the canonical location, not having to duplicate them in the build system section. |
@stefanv -- How much of this is covered by the fact that we support |
Hi @charliermarsh, thanks for pointing out that feature (BTW, I notice that the |
Sorry, yes, I forgot that this issue was about build dependencies. I came here after reading the |
We are also very much missing this feature. For example, wanting to run It would be great if the |
Are you looking for |
ref: pypa/pip#11440 (comment)
In our CI, we often need to install build-dependencies for a project, without installing the project itself.
At the moment, there is no easy way of telling pip to do that.
We've resorted to compiling requirements files from pyproject.toml, but it would be convenient if we could install dependencies directly.
The text was updated successfully, but these errors were encountered: