-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Development dependency group support #5632
Comments
@mishamsk regarding
We may tackle this behavior before PEP 735 is finalized, but we are not going to include this in our upcoming stable release (in the next couple months). In the meantime, we want to:
|
@zanieb thanks.
I can elaborate a bit on my use case assuming this is the right place: So first a rough setup we have for context:
Group requirements
I think this is it... I'll add more if I remember something. Sorry for a long read |
Thanks for the context!
You highlight this already, but this is a problem in Poetry because it solves for all groups at once and does not allow incompatibilities. This is a problem for us too! If we allow incompatible groups, we have to solve for all possible combinations of the groups to create a lockfile for the project. We're hoping this case is addressed by project-level tools or perhaps in PEP 735. |
yes, at least in my case, this is essentially about project-level tools. E.g., I have the latest ruff system wide, but lock different versions for specific projects. From the vantage point of this use cases, it may make sense to have all the groups in their own isolated environments. I know that project-level tools are out of scope for now, but I can imagine a simple solution where "project-level tool" is just telling uv that a specific version of a tool should be used inside this specific project. Then it will work similar to how pyenv/asdf/mise/rye etc handle python itself - shims/path manipulation. No local secondary .venv's for tools, no cross compilation of dependencies etc. But others may come up with other use cases. Poetry threads related to groups are numerous and very long! |
I think basic support for development dependency groups and scripts could replace other popular environment management/command running tools like These features would provide a good way to organize dependencies, modularize CI/CD pipelines, and standardize common commands/aliases among teammates and CI/CD by centralizing them in Example
|
Hi everyone, I have a workflow almost similar to @chrisrodrigue, so I really hope this feature will be added. It will help poetry (or pdm) users like me to switch to uv. |
I think one important use case when talking about replacing tox or hatch wasn't explicitly mentioned yet. The possibility to target multiple python versions. When you develop libraries instead of applications you want to support a wide range of Python versions and define test environment for various Python versions. Another use case would be targeting different versions of a library. For example when you are developing a pytest plugin you want to test this against various versions of pytest. These use cases should be considered when uv is providing a feature for multiple development environments. See for example matrix documentation from hatch: https://hatch.pypa.io/1.12/environment/#matrix |
Here are two real world tox configurations covering these use cases. https://github.com/pallets/flask/blob/main/tox.ini |
PDM support this and have some use cases examples (I have similar use cases) https://pdm-project.org/latest/usage/dependency/#add-development-only-dependencies |
Our usecase for dependency groups is "distribution". We develop in a bigish application with many components in a single package. For example, imagine the package is These components are executed by running some Docker images we generate (one per component). These docker images install In that same vein, some GitHub Actions only need some dependency groups to run, which makes the venv cache recovery faster (because resulting venvs are smaller). I recognize that this compartmentalization is a bit horrible as it needs human knowledge of which sub-packages use which dependency groups, and only works because the packages imported when executing |
I like to have separation of concerns so I know which development dependencies are used for what, and for test sessions in nox (typing, linting, pytest unit tests), I don't want to have extra dependencies that a user won't have if they just install the package in a clean environment impact the results or have tests that only pass because of extra transitive dependencies pulled in by other development tools. |
I totally agree with this distribution problem description and add one vote in favor of this use case that imho justifies the need for dependency groups in corporate setup. |
Another usecase is for part of the Machine Learning community where GPU dependencies should only be installed at training time, but during inference can be handled by the much smaller CPU dependencies. |
Seems this is now tracked in #8090 so either this or the new issue could be closed as duplicate. |
This is a tracking issue for the general idea of putting development dependencies into named groups for partial installs.
In part, we're waiting to see where PEP 735 goes, which
Related:
uv pip compile
#5278 (comment)The text was updated successfully, but these errors were encountered: