From 573b9913983d1ca211bdcc787c7c18df910c6c1c Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Thu, 10 Jul 2025 08:10:21 -0500 Subject: [PATCH] Add nesting groups documentation for dependency groups (#14539) --- docs/concepts/projects/dependencies.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/concepts/projects/dependencies.md b/docs/concepts/projects/dependencies.md index 22d030637..e5c64a3ee 100644 --- a/docs/concepts/projects/dependencies.md +++ b/docs/concepts/projects/dependencies.md @@ -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 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 By default, uv includes the `dev` dependency group in the environment (e.g., during `uv run` or