Add nesting groups documentation for dependency groups (#14539)

This commit is contained in:
Zanie Blue 2025-07-10 08:10:21 -05:00 committed by GitHub
parent f900ef9e57
commit 573b991398
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 20 additions and 0 deletions

View File

@ -679,6 +679,26 @@ to resolve the requirements of the project with an error.
If you have dependency groups that conflict with one another, resolution will fail If you have dependency groups that conflict with one another, resolution will fail
unless you explicitly [declare them as conflicting](./config.md#conflicting-dependencies). unless you explicitly [declare them as conflicting](./config.md#conflicting-dependencies).
### Nesting groups
A dependency group can include other dependency groups, e.g.:
```toml title="pyproject.toml"
[dependency-groups]
dev = [
{include-group = "lint"}
{include-group = "test"}
]
lint = [
"ruff"
]
test = [
"pytest"
]
```
An included group's dependencies cannot conflict with the other dependencies declared in a group.
### Default groups ### Default groups
By default, uv includes the `dev` dependency group in the environment (e.g., during `uv run` or By default, uv includes the `dev` dependency group in the environment (e.g., during `uv run` or