From 8bb5b63009f30a8d8c1f8f0756c21364dba2a111 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 24 Apr 2025 16:31:24 -0400 Subject: [PATCH] Make `--frozen` and `--no-sources` conflicting options (#12671) Alternatively, we could just warn. Closes https://github.com/astral-sh/uv/issues/12653. --- crates/uv-cli/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index ba6076ed0..2a15ba20f 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -3024,7 +3024,7 @@ pub struct RunArgs { /// source of truth. If the lockfile is missing, uv will exit with an error. If the /// `pyproject.toml` includes changes to dependencies that have not been included in the /// lockfile yet, they will not be present in the environment. - #[arg(long, env = EnvVars::UV_FROZEN, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with = "locked")] + #[arg(long, env = EnvVars::UV_FROZEN, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with_all = ["locked", "upgrade", "no_sources"])] pub frozen: bool, /// Run the given path as a Python script. @@ -3272,7 +3272,7 @@ pub struct SyncArgs { /// source of truth. If the lockfile is missing, uv will exit with an error. If the /// `pyproject.toml` includes changes to dependencies that have not been included in the /// lockfile yet, they will not be present in the environment. - #[arg(long, env = EnvVars::UV_FROZEN, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with = "locked")] + #[arg(long, env = EnvVars::UV_FROZEN, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with_all = ["locked", "upgrade", "no_sources"])] pub frozen: bool, /// Perform a dry run, without writing the lockfile or modifying the project environment. @@ -3526,7 +3526,7 @@ pub struct AddArgs { /// Add dependencies without re-locking the project. /// /// The project environment will not be synced. - #[arg(long, env = EnvVars::UV_FROZEN, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with = "locked")] + #[arg(long, env = EnvVars::UV_FROZEN, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with_all = ["locked", "upgrade", "no_sources"])] pub frozen: bool, /// Prefer the active virtual environment over the project's virtual environment. @@ -3631,7 +3631,7 @@ pub struct RemoveArgs { /// Remove dependencies without re-locking the project. /// /// The project environment will not be synced. - #[arg(long, env = EnvVars::UV_FROZEN, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with = "locked")] + #[arg(long, env = EnvVars::UV_FROZEN, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with_all = ["locked", "upgrade", "no_sources"])] pub frozen: bool, #[command(flatten)] @@ -3753,7 +3753,7 @@ pub struct TreeArgs { /// Display the requirements without locking the project. /// /// If the lockfile is missing, uv will exit with an error. - #[arg(long, env = EnvVars::UV_FROZEN, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with = "locked")] + #[arg(long, env = EnvVars::UV_FROZEN, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with_all = ["locked", "upgrade", "no_sources"])] pub frozen: bool, #[command(flatten)] @@ -3983,7 +3983,7 @@ pub struct ExportArgs { /// Do not update the `uv.lock` before exporting. /// /// If a `uv.lock` does not exist, uv will exit with an error. - #[arg(long, env = EnvVars::UV_FROZEN, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with = "locked")] + #[arg(long, env = EnvVars::UV_FROZEN, value_parser = clap::builder::BoolishValueParser::new(), conflicts_with_all = ["locked", "upgrade", "no_sources"])] pub frozen: bool, #[command(flatten)]