diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index c3e6588b6..d582c1b5b 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -1757,7 +1757,7 @@ pub struct AddArgs { /// /// Without this flag uv will try to use `tool.uv.sources` for any sources. #[arg(long)] - pub raw: bool, + pub raw_sources: bool, /// Specific commit to use when adding from Git. #[arg(long)] diff --git a/crates/uv/src/commands/project/add.rs b/crates/uv/src/commands/project/add.rs index 30e2d5366..ba745507d 100644 --- a/crates/uv/src/commands/project/add.rs +++ b/crates/uv/src/commands/project/add.rs @@ -28,7 +28,7 @@ pub(crate) async fn add( requirements: Vec, dev: bool, editable: Option, - raw: bool, + raw_sources: bool, rev: Option, tag: Option, branch: Option, @@ -148,7 +148,7 @@ pub(crate) async fn add( // Add the requirements to the `pyproject.toml`. let mut pyproject = PyProjectTomlMut::from_toml(project.current_project().pyproject_toml())?; for req in requirements { - let (req, source) = if raw { + let (req, source) = if raw_sources { // Use the PEP 508 requirement directly. (pep508_rs::Requirement::from(req), None) } else { @@ -167,7 +167,7 @@ pub(crate) async fn add( let source = match result { Ok(source) => source, Err(SourceError::UnresolvedReference(rev)) => { - anyhow::bail!("Cannot resolve Git reference `{rev}` for requirement `{}`. Specify the reference with one of `--tag`, `--branch`, or `--rev`, or use the `--raw` flag.", req.name) + anyhow::bail!("Cannot resolve Git reference `{rev}` for requirement `{}`. Specify the reference with one of `--tag`, `--branch`, or `--rev`, or use the `--raw-sources` flag.", req.name) } Err(err) => return Err(err.into()), }; diff --git a/crates/uv/src/main.rs b/crates/uv/src/main.rs index 260487e73..2a205fdb8 100644 --- a/crates/uv/src/main.rs +++ b/crates/uv/src/main.rs @@ -721,7 +721,7 @@ async fn run() -> Result { args.requirements, args.dev, args.editable, - args.raw, + args.raw_sources, args.rev, args.tag, args.branch, diff --git a/crates/uv/src/settings.rs b/crates/uv/src/settings.rs index b5d91814a..c984a5a5f 100644 --- a/crates/uv/src/settings.rs +++ b/crates/uv/src/settings.rs @@ -433,7 +433,7 @@ pub(crate) struct AddSettings { pub(crate) requirements: Vec, pub(crate) dev: bool, pub(crate) editable: Option, - pub(crate) raw: bool, + pub(crate) raw_sources: bool, pub(crate) rev: Option, pub(crate) tag: Option, pub(crate) branch: Option, @@ -451,7 +451,7 @@ impl AddSettings { requirements, dev, editable, - raw, + raw_sources, rev, tag, branch, @@ -471,7 +471,7 @@ impl AddSettings { requirements, dev, editable, - raw, + raw_sources, rev, tag, branch, diff --git a/crates/uv/tests/edit.rs b/crates/uv/tests/edit.rs index 46279a236..e5d2dceb9 100644 --- a/crates/uv/tests/edit.rs +++ b/crates/uv/tests/edit.rs @@ -167,7 +167,7 @@ fn add_git() -> Result<()> { ----- stdout ----- ----- stderr ----- - error: Cannot resolve Git reference `0.0.1` for requirement `uv-public-pypackage`. Specify the reference with one of `--tag`, `--branch`, or `--rev`, or use the `--raw` flag. + error: Cannot resolve Git reference `0.0.1` for requirement `uv-public-pypackage`. Specify the reference with one of `--tag`, `--branch`, or `--rev`, or use the `--raw-sources` flag. "###); uv_snapshot!(context.filters(), context.add(&["uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage"]).arg("--tag=0.0.1").arg("--preview"), @r###" @@ -277,7 +277,7 @@ fn add_git() -> Result<()> { Ok(()) } -/// Add a Git requirement using the `--raw` API. +/// Add a Git requirement using the `--raw-sources` API. #[test] fn add_git_raw() -> Result<()> { let context = TestContext::new("3.12"); @@ -317,7 +317,7 @@ fn add_git_raw() -> Result<()> { "###); // Use an ambiguous tag reference, which would otherwise not resolve. - uv_snapshot!(context.filters(), context.add(&["uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@0.0.1"]).arg("--raw").arg("--preview"), @r###" + uv_snapshot!(context.filters(), context.add(&["uv-public-pypackage @ git+https://github.com/astral-test/uv-public-pypackage@0.0.1"]).arg("--raw-sources").arg("--preview"), @r###" success: true exit_code: 0 ----- stdout -----