Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak installation language in toolchain install #4811

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/uv-python/src/downloads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ impl ManagedPythonDownload {
parent_path: &Path,
) -> Result<DownloadResult, Error> {
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() {
Expand All @@ -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}");
Expand Down
17 changes: 7 additions & 10 deletions crates/uv/src/commands/python/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())?;
Expand All @@ -88,26 +88,23 @@ pub(crate) async fn install(
if matches!(requests.as_slice(), [PythonRequest::Any]) {
writeln!(
printer.stderr(),
"A installation is already installed. Use `uv installation install <request>` to install a specific installation.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn.

"Python is already available. Use `uv python install <request>` 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);
}

if unfilled_requests.len() > 1 {
writeln!(
printer.stderr(),
"Found {}/{} installations requiring installation",
"Found {}/{} versions requiring installation",
unfilled_requests.len(),
requests.len()
)?;
Expand Down Expand Up @@ -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()
)?;
Expand Down
5 changes: 4 additions & 1 deletion crates/uv/src/commands/python/uninstall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Loading