diff --git a/Cargo.lock b/Cargo.lock index dfa6e6fff8a6..a2f188be3762 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4828,7 +4828,6 @@ dependencies = [ "insta", "install-wheel-rs", "nanoid", - "path-absolutize", "pep440_rs", "pep508_rs", "platform-tags", diff --git a/crates/requirements-txt/src/snapshots/requirements_txt__test__parse-windows-bare-url.txt.snap b/crates/requirements-txt/src/snapshots/requirements_txt__test__parse-windows-bare-url.txt.snap index 68a137a00c20..f005012dc419 100644 --- a/crates/requirements-txt/src/snapshots/requirements_txt__test__parse-windows-bare-url.txt.snap +++ b/crates/requirements-txt/src/snapshots/requirements_txt__test__parse-windows-bare-url.txt.snap @@ -22,7 +22,6 @@ RequirementsTxt { fragment: None, }, install_path: "/scripts/packages/black_editable", - lock_path: "./scripts/packages/black_editable", editable: false, }, ), @@ -72,7 +71,6 @@ RequirementsTxt { fragment: None, }, install_path: "/scripts/packages/black_editable", - lock_path: "./scripts/packages/black_editable", editable: false, }, ), @@ -126,7 +124,6 @@ RequirementsTxt { fragment: None, }, install_path: "/scripts/packages/black_editable", - lock_path: "scripts/packages/black_editable", editable: false, }, ), diff --git a/crates/requirements-txt/src/snapshots/requirements_txt__test__parse-windows-editable.txt.snap b/crates/requirements-txt/src/snapshots/requirements_txt__test__parse-windows-editable.txt.snap index f3129dda14c7..39250d9388ca 100644 --- a/crates/requirements-txt/src/snapshots/requirements_txt__test__parse-windows-editable.txt.snap +++ b/crates/requirements-txt/src/snapshots/requirements_txt__test__parse-windows-editable.txt.snap @@ -24,7 +24,6 @@ RequirementsTxt { fragment: None, }, install_path: "/editable", - lock_path: "./editable", editable: true, }, ), @@ -81,7 +80,6 @@ RequirementsTxt { fragment: None, }, install_path: "/editable", - lock_path: "./editable", editable: true, }, ), @@ -138,7 +136,6 @@ RequirementsTxt { fragment: None, }, install_path: "/editable", - lock_path: "./editable", editable: true, }, ), @@ -195,7 +192,6 @@ RequirementsTxt { fragment: None, }, install_path: "/editable", - lock_path: "./editable", editable: true, }, ), @@ -252,7 +248,6 @@ RequirementsTxt { fragment: None, }, install_path: "/editable", - lock_path: "./editable", editable: true, }, ), @@ -302,7 +297,6 @@ RequirementsTxt { fragment: None, }, install_path: "/editable[d", - lock_path: "./editable[d", editable: true, }, ), diff --git a/crates/uv-distribution/Cargo.toml b/crates/uv-distribution/Cargo.toml index 6fc8b98bd6e0..0aaef1a3e320 100644 --- a/crates/uv-distribution/Cargo.toml +++ b/crates/uv-distribution/Cargo.toml @@ -35,7 +35,6 @@ anyhow = { workspace = true } fs-err = { workspace = true } futures = { workspace = true } nanoid = { workspace = true } -path-absolutize = { workspace = true } reqwest = { workspace = true } reqwest-middleware = { workspace = true } rmp-serde = { workspace = true } diff --git a/crates/uv-distribution/src/metadata/lowering.rs b/crates/uv-distribution/src/metadata/lowering.rs index 80e2d2dce8da..669ebcfe3be5 100644 --- a/crates/uv-distribution/src/metadata/lowering.rs +++ b/crates/uv-distribution/src/metadata/lowering.rs @@ -2,7 +2,6 @@ use std::collections::BTreeMap; use std::io; use std::path::{Path, PathBuf}; -use path_absolutize::Absolutize; use thiserror::Error; use url::Url; diff --git a/crates/uv-fs/src/path.rs b/crates/uv-fs/src/path.rs index 622d4855ba22..5174817f9877 100644 --- a/crates/uv-fs/src/path.rs +++ b/crates/uv-fs/src/path.rs @@ -7,19 +7,12 @@ use path_slash::PathExt; /// The current working directory. pub static CWD: LazyLock = - LazyLock::new(|| { - std::env::var("UV_CWD") - .ok() - .map(PathBuf::from) - .unwrap_or_else(|| std::env::current_dir().expect("The current directory must exist")) - }); + LazyLock::new(|| std::env::current_dir().expect("The current directory must exist")); /// The current working directory, canonicalized. pub static CANONICAL_CWD: LazyLock = LazyLock::new(|| { - std::env::var("UV_CWD") - .ok() - .map(PathBuf::from) - .unwrap_or_else(|| std::env::current_dir().expect("The current directory must exist")) + std::env::current_dir() + .expect("The current directory must exist") .canonicalize() .expect("The current directory must be canonicalized") }); @@ -281,9 +274,6 @@ pub fn relative_to( path: impl AsRef, base: impl AsRef, ) -> Result { - // println!("path: {}", path.as_ref().display()); - // println!("base: {}", base.as_ref().display()); - // Find the longest common prefix, and also return the path stripped from that prefix let (stripped, common_prefix) = base .as_ref() diff --git a/crates/uv-resolver/src/lock.rs b/crates/uv-resolver/src/lock.rs index 79e6f3033b08..6820bee065ed 100644 --- a/crates/uv-resolver/src/lock.rs +++ b/crates/uv-resolver/src/lock.rs @@ -1928,9 +1928,6 @@ impl Source { } fn from_path_source_dist(path_dist: &PathSourceDist, root: &Path) -> Result { - - - let path = relative_to(&path_dist.install_path, root) .map_err(LockErrorKind::DistributionRelativePath)?; diff --git a/crates/uv-workspace/src/workspace.rs b/crates/uv-workspace/src/workspace.rs index 87ab4633d6e0..6a1c69a6afc4 100644 --- a/crates/uv-workspace/src/workspace.rs +++ b/crates/uv-workspace/src/workspace.rs @@ -169,8 +169,6 @@ impl Workspace { pyproject_toml, }); - - Self::collect_members( workspace_root.clone(), workspace_definition, diff --git a/crates/uv/src/commands/project/lock.rs b/crates/uv/src/commands/project/lock.rs index 95a4b14dc7e2..21b11ac5b674 100644 --- a/crates/uv/src/commands/project/lock.rs +++ b/crates/uv/src/commands/project/lock.rs @@ -1,7 +1,6 @@ #![allow(clippy::single_match_else)] use std::collections::BTreeSet; -use std::env; use std::fmt::Write; use anstream::eprint; @@ -77,7 +76,7 @@ pub(crate) async fn lock( printer: Printer, ) -> anyhow::Result { // Find the project requirements. - let workspace = Workspace::discover(&*CWD, &DiscoveryOptions::default()).await?; + let workspace = Workspace::discover(&CWD, &DiscoveryOptions::default()).await?; // Find an interpreter for the project let interpreter = FoundInterpreter::discover( diff --git a/crates/uv/tests/common/mod.rs b/crates/uv/tests/common/mod.rs index 1840ab8833b9..d8e4f8daa7d8 100644 --- a/crates/uv/tests/common/mod.rs +++ b/crates/uv/tests/common/mod.rs @@ -210,9 +210,6 @@ impl TestContext { let canonical_temp_dir = temp_dir.canonicalize().unwrap(); let venv = ChildPath::new(canonical_temp_dir.join(".venv")); - println!("temp_dir: {:?}", temp_dir.path()); - println!("canonical_temp_dir: {:?}", canonical_temp_dir); - let python_version = python_versions .first() .map(|version| PythonVersion::from_str(version).unwrap()); @@ -399,7 +396,6 @@ impl TestContext { .env("UV_TEST_PYTHON_PATH", self.python_path()) .env("UV_EXCLUDE_NEWER", EXCLUDE_NEWER) .current_dir(self.temp_dir.path()); - println!("current_dir: {:?}", self.temp_dir.path()); if cfg!(all(windows, debug_assertions)) { // TODO(konstin): Reduce stack usage in debug mode enough that the tests pass with the diff --git a/crates/uv/tests/lock.rs b/crates/uv/tests/lock.rs index 1ea01d951d9b..e35a49de0d8c 100644 --- a/crates/uv/tests/lock.rs +++ b/crates/uv/tests/lock.rs @@ -7106,8 +7106,6 @@ fn lock_sources_archive() -> Result<()> { let mut workspace_archive_file = fs_err::File::create(&*workspace_archive)?; std::io::copy(&mut response.bytes()?.as_ref(), &mut workspace_archive_file)?; - - let pyproject_toml = context.temp_dir.child("pyproject.toml"); pyproject_toml.write_str(&formatdoc! { r#" @@ -7134,8 +7132,8 @@ fn lock_sources_archive() -> Result<()> { // insta::with_settings!({ // filters => context.filters(), // }, { - assert_snapshot!( - lock, @r###" + assert_snapshot!( + lock, @r###" version = 1 requires-python = ">=3.12" @@ -7195,7 +7193,7 @@ fn lock_sources_archive() -> Result<()> { [package.metadata] requires-dist = [{ name = "anyio" }] "### - ); + ); // }); // Re-run with `--locked`.