Skip to content
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
2 changes: 1 addition & 1 deletion crates/uv-auth/src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2235,7 +2235,7 @@ mod tests {
assert!(matches!(
client.get(server.uri()).send().await,
Err(reqwest_middleware::Error::Middleware(_))
),);
));

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-distribution/src/source/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
}
Ok(None) => {}
Err(err) => {
debug!("Failed to deserialize cached revision for: {source} ({err})",);
debug!("Failed to deserialize cached revision for: {source} ({err})");
}
}
}
Expand Down
37 changes: 18 additions & 19 deletions crates/uv-installer/src/satisfies.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::borrow::Cow;
use std::fmt::Debug;

use owo_colors::OwoColorize;
use same_file::is_same_file;
use tracing::{debug, trace};
use url::Url;
Expand Down Expand Up @@ -399,18 +398,18 @@ fn generate_dist_compatibility_hint(wheel_tags: &ExpandedTags, tags: &Tags) -> O

if let Some(current) = current_tag {
let message = if let Some(pretty) = current.pretty() {
format!("{} (`{}`)", pretty.cyan(), current.cyan())
format!("{pretty} (`{current}`)")
} else {
format!("`{}`", current.cyan())
format!("`{current}`")
};

Some(format!(
"The distribution is compatible with {}, but you're using {}",
wheel_tags
.map(|tag| if let Some(pretty) = tag.pretty() {
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
format!("{pretty} (`{tag}`)")
} else {
format!("`{}`", tag.cyan())
format!("`{tag}`")
})
.collect::<Vec<_>>()
.join(", "),
Expand All @@ -421,9 +420,9 @@ fn generate_dist_compatibility_hint(wheel_tags: &ExpandedTags, tags: &Tags) -> O
"The distribution requires {}",
wheel_tags
.map(|tag| if let Some(pretty) = tag.pretty() {
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
format!("{pretty} (`{tag}`)")
} else {
format!("`{}`", tag.cyan())
format!("`{tag}`")
})
.collect::<Vec<_>>()
.join(", ")
Expand All @@ -436,17 +435,17 @@ fn generate_dist_compatibility_hint(wheel_tags: &ExpandedTags, tags: &Tags) -> O

if let Some(current) = current_tag {
let message = if let Some(pretty) = current.pretty() {
format!("{} (`{}`)", pretty.cyan(), current.cyan())
format!("{pretty} (`{current}`)")
} else {
format!("`{}`", current.cyan())
format!("`{current}`")
};
Some(format!(
"The distribution is compatible with {}, but you're using {}",
wheel_tags
.map(|tag| if let Some(pretty) = tag.pretty() {
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
format!("{pretty} (`{tag}`)")
} else {
format!("`{}`", tag.cyan())
format!("`{tag}`")
})
.collect::<Vec<_>>()
.join(", "),
Expand All @@ -457,9 +456,9 @@ fn generate_dist_compatibility_hint(wheel_tags: &ExpandedTags, tags: &Tags) -> O
"The distribution requires {}",
wheel_tags
.map(|tag| if let Some(pretty) = tag.pretty() {
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
format!("{pretty} (`{tag}`)")
} else {
format!("`{}`", tag.cyan())
format!("`{tag}`")
})
.collect::<Vec<_>>()
.join(", ")
Expand All @@ -472,17 +471,17 @@ fn generate_dist_compatibility_hint(wheel_tags: &ExpandedTags, tags: &Tags) -> O

if let Some(current) = current_tag {
let message = if let Some(pretty) = current.pretty() {
format!("{} (`{}`)", pretty.cyan(), current.cyan())
format!("{pretty} (`{current}`)")
} else {
format!("`{}`", current.cyan())
format!("`{current}`")
};
Some(format!(
"The distribution is compatible with {}, but you're on {}",
wheel_tags
.map(|tag| if let Some(pretty) = tag.pretty() {
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
format!("{pretty} (`{tag}`)")
} else {
format!("`{}`", tag.cyan())
format!("`{tag}`")
})
.collect::<Vec<_>>()
.join(", "),
Expand All @@ -493,9 +492,9 @@ fn generate_dist_compatibility_hint(wheel_tags: &ExpandedTags, tags: &Tags) -> O
"The distribution requires {}",
wheel_tags
.map(|tag| if let Some(pretty) = tag.pretty() {
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
format!("{pretty} (`{tag}`)")
} else {
format!("`{}`", tag.cyan())
format!("`{tag}`")
})
.collect::<Vec<_>>()
.join(", ")
Expand Down
4 changes: 2 additions & 2 deletions crates/uv-python/src/downloads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1728,8 +1728,8 @@ mod tests {
request.version,
Some(VersionRequest::from_str("3.13.0rc1").unwrap())
);
assert_eq!(request.os, None,);
assert_eq!(request.arch, None,);
assert_eq!(request.os, None);
assert_eq!(request.arch, None);
assert_eq!(request.libc, None);
}

Expand Down
19 changes: 7 additions & 12 deletions crates/uv/src/commands/python/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ pub(crate) async fn install(
.peekable();

if matching_installations.peek().is_none() {
debug!("No installation found for request `{}`", request.cyan());
debug!("No installation found for request `{}`", request);
unsatisfied.push(Cow::Borrowed(request));
}

Expand All @@ -325,7 +325,7 @@ pub(crate) async fn install(
python_downloads_json_url.as_deref(),
) {
Ok(request) => {
debug!("Will reinstall `{}`", installation.key().green());
debug!("Will reinstall `{}`", installation.key());
unsatisfied.push(Cow::Owned(request));
}
Err(err) => {
Expand All @@ -344,8 +344,8 @@ pub(crate) async fn install(
// If we have real requests, just ignore the existing installation
debug!(
"Ignoring match `{}` for request `{}` due to `--reinstall` flag",
installation.key().green(),
request.cyan()
installation.key(),
request
);
unsatisfied.push(Cow::Borrowed(request));
break;
Expand All @@ -366,14 +366,10 @@ pub(crate) async fn install(
request.matches_installation(installation)
}
}) {
debug!(
"Found `{}` for request `{}`",
installation.key().green(),
request.cyan(),
);
debug!("Found `{}` for request `{}`", installation.key(), request);
Either::Left(installation)
} else {
debug!("No installation found for request `{}`", request.cyan());
debug!("No installation found for request `{}`", request);
Either::Right(Cow::Borrowed(request))
}
})
Expand All @@ -394,8 +390,7 @@ pub(crate) async fn install(
.inspect(|request| {
debug!(
"Found download `{}` for request `{}`",
request.download,
request.cyan(),
request.download, request,
);
})
.map(|request| request.download)
Expand Down
Loading