Add [tool.uv.dependency-groups].mygroup.requires-python (#13735)

This allows you to specify requires-python on individual dependency-groups,
with the intended usecase being "oh my dev-dependencies have a higher
requires-python than my actual project".

This includes a large driveby move of the RequiresPython type to
uv-distribution-types to allow us to generate the appropriate markers at
this point in the code. It also migrates RequiresPython from
pubgrub::Range to version_ranges::Ranges, and makes several pub(crate)
items pub, as it's no longer defined in uv_resolver.

Fixes #11606
This commit is contained in:
Aria Desires 2025-06-13 18:04:13 -04:00 committed by GitHub
parent 26db29caac
commit 5021840919
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
54 changed files with 2072 additions and 538 deletions

View file

@ -127,6 +127,31 @@ default-groups = ["docs"]
---
### [`dependency-groups`](#dependency-groups) {: #dependency-groups }
Additional settings for `dependency-groups`.
Currently this can only be used to add `requires-python` constraints
to dependency groups (typically to inform uv that your dev tooling
has a higher python requirement than your actual project).
This cannot be used to define dependency groups, use the top-level
`[dependency-groups]` table for that.
**Default value**: `[]`
**Type**: `dict`
**Example usage**:
```toml title="pyproject.toml"
[tool.uv.dependency-groups]
my-group = {requires-python = ">=3.12"}
```
---
### [`dev-dependencies`](#dev-dependencies) {: #dev-dependencies }
The project's development dependencies.