From a235b7d70da93f4471dd2039cb9be1f9ecf460ec Mon Sep 17 00:00:00 2001 From: You Jiacheng <1503679330@qq.com> Date: Thu, 19 Sep 2024 20:02:42 +0800 Subject: [PATCH] Clarify behavior of of overrides in CLI reference (#7537) ## Summary Improve the description of override-dependencies based on the statement in `concepts/resolution.md`: "As with constraints, overrides do not add a dependency on the package and only take effect if the package is requested in a direct or transitive dependency." I tested it locally, `concepts/resolution.md` is correct. It would be better to also include this in the Reference Chapter of the docs. --- crates/uv-workspace/src/pyproject.rs | 4 ++++ docs/reference/settings.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/crates/uv-workspace/src/pyproject.rs b/crates/uv-workspace/src/pyproject.rs index 368a9b9cb312..4553468cb21c 100644 --- a/crates/uv-workspace/src/pyproject.rs +++ b/crates/uv-workspace/src/pyproject.rs @@ -230,6 +230,10 @@ pub struct ToolUv { /// constituent packages, overrides are _absolute_, in that they completely replace the /// requirements of any constituent packages. /// + /// Including a package as an override will _not_ trigger installation of the package on its + /// own; instead, the package must be requested elsewhere in the project's first-party or + /// transitive dependencies. + /// /// !!! note /// In `uv lock`, `uv sync`, and `uv run`, uv will only read `override-dependencies` from /// the `pyproject.toml` at the workspace root, and will ignore any declarations in other diff --git a/docs/reference/settings.md b/docs/reference/settings.md index f71c47405b7c..97718c304788 100644 --- a/docs/reference/settings.md +++ b/docs/reference/settings.md @@ -103,6 +103,10 @@ While constraints are _additive_, in that they're combined with the requirements constituent packages, overrides are _absolute_, in that they completely replace the requirements of any constituent packages. +Including a package as an override will _not_ trigger installation of the package on its +own; instead, the package must be requested elsewhere in the project's first-party or +transitive dependencies. + !!! note In `uv lock`, `uv sync`, and `uv run`, uv will only read `override-dependencies` from the `pyproject.toml` at the workspace root, and will ignore any declarations in other