From 44faee4fc2ea1979731bd78cf65b5a69e315d437 Mon Sep 17 00:00:00 2001 From: j178 <10510431+j178@users.noreply.github.com> Date: Sat, 20 Jul 2024 20:28:25 +0800 Subject: [PATCH] Add `uv add --no-editable` --- crates/uv-cli/src/lib.rs | 9 ++++++--- crates/uv/src/settings.rs | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index b57e93650250..710a54deb2e0 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -1983,9 +1983,12 @@ pub struct AddArgs { #[arg(long, conflicts_with("dev"))] pub optional: Option, - /// Add the requirements as editables. - #[arg(long, default_missing_value = "true", num_args(0..=1))] - pub editable: Option, + #[arg(long, overrides_with = "no_editable", hide = true)] + pub editable: bool, + + /// Don't add the requirements as editables. + #[arg(long, overrides_with = "editable")] + pub no_editable: bool, /// Add source requirements to the `project.dependencies` section of the `pyproject.toml`. /// diff --git a/crates/uv/src/settings.rs b/crates/uv/src/settings.rs index 3d25120f03bb..286c90a73b93 100644 --- a/crates/uv/src/settings.rs +++ b/crates/uv/src/settings.rs @@ -609,6 +609,7 @@ impl AddSettings { dev, optional, editable, + no_editable, extra, raw_sources, rev, @@ -641,13 +642,13 @@ impl AddSettings { frozen, requirements, dependency_type, - editable, raw_sources, rev, tag, branch, package, python, + editable: flag(editable, no_editable), extras: extra.unwrap_or_default(), refresh: Refresh::from(refresh), settings: ResolverInstallerSettings::combine(