Add tool.uv.build-constraint-dependencies to pyproject.toml (#11585)

## Summary

Resolves #6913. 

Add `tool.uv.build-constraint-dependencies` to pyproject.toml.
The changes are analogous to the constraint-dependencies feature
implemented in #5248.

Add documentation for `build-constraint-dependencies`

## Test Plan

Add tests for `uv lock`, `uv add`, `uv pip install` and `uv pip
compile`.

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
This commit is contained in:
Chao Ning 2025-02-18 01:58:36 +00:00 committed by GitHub
parent 8996d5c358
commit 8c3a6b2155
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 879 additions and 8 deletions

View file

@ -1,4 +1,35 @@
## Project metadata
### [`build-constraint-dependencies`](#build-constraint-dependencies) {: #build-constraint-dependencies }
Constraints to apply when solving build dependencies.
Build constraints are used to restrict the versions of build dependencies that are selected
when building a package during resolution or installation.
Including a package as a constraint will _not_ trigger installation of the package during
a build; instead, the package must be requested elsewhere in the project's build dependency
graph.
!!! note
In `uv lock`, `uv sync`, and `uv run`, uv will only read `build-constraint-dependencies` from
the `pyproject.toml` at the workspace root, and will ignore any declarations in other
workspace members or `uv.toml` files.
**Default value**: `[]`
**Type**: `list[str]`
**Example usage**:
```toml title="pyproject.toml"
[tool.uv]
# Ensure that the setuptools v60.0.0 is used whenever a package has a build dependency
# on setuptools.
build-constraint-dependencies = ["setuptools==60.0.0"]
```
---
### [`conflicts`](#conflicts) {: #conflicts }
Declare collections of extras or dependency groups that are conflicting