From 9cd28fba2ede3e67377eb39ec54890ac34f949bd Mon Sep 17 00:00:00 2001 From: Aria Desires Date: Thu, 26 Jun 2025 12:15:34 -0400 Subject: [PATCH] add docs for dependency group `requires-python` --- docs/concepts/projects/dependencies.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/concepts/projects/dependencies.md b/docs/concepts/projects/dependencies.md index 42a579695..744da606e 100644 --- a/docs/concepts/projects/dependencies.md +++ b/docs/concepts/projects/dependencies.md @@ -701,6 +701,19 @@ default-groups = "all" To disable this behaviour during `uv run` or `uv sync`, use `--no-default-groups`. To exclude a specific default group, use `--no-group `. +### Group `requires-python` + +If your dependency groups require a higher version of python than your project does, you can specify +a `requires-python` for the group in `[tool.uv.dependency-groups]` as follows: + +```toml title="pyproject.toml" +[dependency-groups] +dev = ["pytest"] + +[tool.uv.dependency-groups] +dev = {requires-python = ">=3.12"} +``` + ### Legacy `dev-dependencies` Before `[dependency-groups]` was standardized, uv used the `tool.uv.dev-dependencies` field to