Enable extra build dependencies to 'match runtime' versions (#15036)

## Summary

This is an alternative to https://github.com/astral-sh/uv/pull/14944
that functions a little differently. Rather than adding separate
strategies, you can instead say:

```toml
[tool.uv.extra-build-dependencies]
child = [{ requirement = "anyio", match-runtime = true }]
```

Which will then enforce that `anyio` uses the same version as in the
lockfile.
This commit is contained in:
Charlie Marsh
2025-08-05 19:00:44 +01:00
committed by GitHub
parent b2c382f7c1
commit 8ef3b2eb8e
11 changed files with 566 additions and 81 deletions
+23 -1
View File
@@ -889,10 +889,32 @@
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/definitions/Requirement"
"$ref": "#/definitions/ExtraBuildDependency"
}
}
},
"ExtraBuildDependency": {
"anyOf": [
{
"$ref": "#/definitions/Requirement"
},
{
"type": "object",
"properties": {
"match-runtime": {
"type": "boolean"
},
"requirement": {
"$ref": "#/definitions/Requirement"
}
},
"required": [
"requirement",
"match-runtime"
]
}
]
},
"ExtraName": {
"description": "The normalized name of an extra dependency.\n\nConverts the name to lowercase and collapses runs of `-`, `_`, and `.` down to a single `-`.\nFor example, `---`, `.`, and `__` are all converted to a single `-`.\n\nSee:\n- <https://peps.python.org/pep-0685/#specification/>\n- <https://packaging.python.org/en/latest/specifications/name-normalization/>",
"type": "string"