Add docs for `constraint-dependencies` and `override-dependencies`
Add missing portions of documents reported in #6518 and #5248(Comment).
Summary
I noticed later that the current project interface (e.g. uv sync) does not read override-dependencies and constraint-dependencies from uv.toml.
Should project interface commands respect constraint-dependencies and override-dependencies in this file?
If so, this needs to be addressed in a separate issue and PR.
~~If not, the uv.toml example needs to be removed from the added documentation.~~
(No need to remove uv pip install/compile as it uses uv.toml.)
I noticed later that the current project interface (e.g. uv sync) does not read override-dependencies and constraint-dependencies from uv.toml.
I believe it does, but only from the workspace root. Are you seeing otherwise?
I believe it does, but only from the workspace root. Are you seeing otherwise?
The user-level configuration (~/.config/uv/uv.toml) might be worth respecting.
For reference, it appears that cargo allows dependencies to be overridden from user-level settings.
https://doc.rust-lang.org/cargo/reference/config.html#patch
I believe it does, but only from the workspace root. Are you seeing otherwise?
Sorry, I misread your answer.
uv pip install and uv pip compile respect override-dependencies and constraint-dependencies in uv.toml.
I share a simple but reproducible command.
$ echo 'override-dependencies=["werkzeug==2.3.0"]' > ~/.config/uv/uv.toml
$ echo flask | uv pip compile -
~~~~
werkzeug==2.3.0
# via
# --override (workspace)
# flask
I'm not sure... I consider this "data" rather than "configuration".
I think it's important for this to be scoped to the project to avoid different resolutions for a project per developer.
I think it's important for this to be scoped to the project to avoid different resolutions for a project per developer.
Ok, that is correct.
To avoid user confusion, I emphasized that only the setting values in pyproject.toml are valid for project interfaces(e.g. uv lock).