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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 566 additions and 81 deletions

View file

@ -328,6 +328,7 @@ impl SourceBuild {
.and_then(|name| extra_build_requires.get(name).cloned())
.unwrap_or_default()
.into_iter()
.map(Requirement::from)
.collect();
// Create a virtual environment, or install into the shared environment if requested.