Tweak installation language in toolchain install (#4811)

## Summary

Like https://github.com/astral-sh/uv/pull/4808 but with a few more
changes. I suspect this will require some bikeshedding but I find the
use of "installation" and "installed" in the same sentence to be kind of
a lot.
This commit is contained in:
Charlie Marsh 2024-07-04 17:05:31 -04:00 committed by GitHub
parent b588054dfb
commit a13ab43a0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 13 deletions

View file

@ -407,7 +407,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() {
@ -429,7 +429,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}");

View file

@ -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 <request>` to install a specific installation.",
"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);
}
@ -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()
)?;

View file

@ -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);
}