From 7e0c9b2e70056767dc01d60feb3b40ef6ab7d78f Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 4 Jul 2024 13:20:29 -0400 Subject: [PATCH] Tweak installation language in toolchain install --- crates/uv-python/src/downloads.rs | 4 ++-- crates/uv/src/commands/python/install.rs | 17 +++++++---------- crates/uv/src/commands/python/uninstall.rs | 5 ++++- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/uv-python/src/downloads.rs b/crates/uv-python/src/downloads.rs index 0c20c054e8c2..a6cdb93b87b3 100644 --- a/crates/uv-python/src/downloads.rs +++ b/crates/uv-python/src/downloads.rs @@ -397,7 +397,7 @@ impl ManagedPythonDownload { parent_path: &Path, ) -> Result { let url = Url::parse(self.url)?; - let path = parent_path.join(self.key().to_string()).clone(); + let path = parent_path.join(self.key().to_string()); // If it already exists, return it if path.is_dir() { @@ -419,7 +419,7 @@ impl ManagedPythonDownload { ); let reader = response .bytes_stream() - .map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err)) + .map_err(|err| io::Error::new(io::ErrorKind::Other, err)) .into_async_read(); debug!("Extracting {filename}"); diff --git a/crates/uv/src/commands/python/install.rs b/crates/uv/src/commands/python/install.rs index ba915a87f1f1..8cb51132b73e 100644 --- a/crates/uv/src/commands/python/install.rs +++ b/crates/uv/src/commands/python/install.rs @@ -67,13 +67,13 @@ pub(crate) async fn install( { writeln!( printer.stderr(), - "Found installed installation `{}` that satisfies {request}", + "Found existing installation `{}` that satisfies {request}", installation.key() )?; if force { writeln!( printer.stderr(), - "Removing installed installation `{}`", + "Removing existing installation `{}`", installation.key() )?; fs::remove_dir_all(installation.path())?; @@ -88,18 +88,15 @@ pub(crate) async fn install( if matches!(requests.as_slice(), [PythonRequest::Any]) { writeln!( printer.stderr(), - "A installation is already installed. Use `uv installation install ` to install a specific installation.", + "Python is already available. Use `uv python install ` to install a specific version.", )?; } else if requests.len() > 1 { writeln!( printer.stderr(), - "All requested installations already installed." + "All requested versions already installed." )?; } else { - writeln!( - printer.stderr(), - "Requested installation already installed." - )?; + writeln!(printer.stderr(), "Requested versions already installed.")?; } return Ok(ExitStatus::Success); } @@ -107,7 +104,7 @@ pub(crate) async fn install( if unfilled_requests.len() > 1 { writeln!( printer.stderr(), - "Found {}/{} installations requiring installation", + "Found {}/{} versions requiring installation", unfilled_requests.len(), requests.len() )?; @@ -158,7 +155,7 @@ pub(crate) async fn install( let s = if downloads.len() == 1 { "" } else { "s" }; writeln!( printer.stderr(), - "Installed {} installation{s} in {}s", + "Installed {} version{s} in {}s", downloads.len(), start.elapsed().as_secs() )?; diff --git a/crates/uv/src/commands/python/uninstall.rs b/crates/uv/src/commands/python/uninstall.rs index 90b4996998ab..8615eeb3556a 100644 --- a/crates/uv/src/commands/python/uninstall.rs +++ b/crates/uv/src/commands/python/uninstall.rs @@ -105,7 +105,10 @@ pub(crate) async fn uninstall( if failed { if matching_installations.len() > 1 { - writeln!(printer.stderr(), "Some Python uninstalls failed")?; + writeln!( + printer.stderr(), + "Failed to remove some Python installations" + )?; } return Ok(ExitStatus::Failure); }