mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-01 22:41:16 +00:00
Move dry-run method to the top-level (#3567)
Trying to pull out some small, no-op refactors.
This commit is contained in:
parent
025368965e
commit
c666e43b90
1 changed files with 129 additions and 129 deletions
|
@ -1020,13 +1020,43 @@ async fn install(
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::items_after_statements)]
|
||||
fn report_dry_run(
|
||||
// TODO(konstin): Also check the cache whether any cached or installed dist is already known to
|
||||
// have been yanked, we currently don't show this message on the second run anymore
|
||||
for dist in &remote {
|
||||
let Some(file) = dist.file() else {
|
||||
continue;
|
||||
};
|
||||
match &file.yanked {
|
||||
None | Some(Yanked::Bool(false)) => {}
|
||||
Some(Yanked::Bool(true)) => {
|
||||
writeln!(
|
||||
printer.stderr(),
|
||||
"{}{} {dist} is yanked.",
|
||||
"warning".yellow().bold(),
|
||||
":".bold(),
|
||||
)?;
|
||||
}
|
||||
Some(Yanked::Reason(reason)) => {
|
||||
writeln!(
|
||||
printer.stderr(),
|
||||
"{}{} {dist} is yanked (reason: \"{reason}\").",
|
||||
"warning".yellow().bold(),
|
||||
":".bold(),
|
||||
)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Report on the results of a dry-run installation.
|
||||
fn report_dry_run(
|
||||
resolution: &Resolution,
|
||||
plan: Plan,
|
||||
start: std::time::Instant,
|
||||
printer: Printer,
|
||||
) -> Result<(), Error> {
|
||||
) -> Result<(), Error> {
|
||||
let Plan {
|
||||
cached,
|
||||
remote,
|
||||
|
@ -1146,36 +1176,6 @@ async fn install(
|
|||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// TODO(konstin): Also check the cache whether any cached or installed dist is already known to
|
||||
// have been yanked, we currently don't show this message on the second run anymore
|
||||
for dist in &remote {
|
||||
let Some(file) = dist.file() else {
|
||||
continue;
|
||||
};
|
||||
match &file.yanked {
|
||||
None | Some(Yanked::Bool(false)) => {}
|
||||
Some(Yanked::Bool(true)) => {
|
||||
writeln!(
|
||||
printer.stderr(),
|
||||
"{}{} {dist} is yanked.",
|
||||
"warning".yellow().bold(),
|
||||
":".bold(),
|
||||
)?;
|
||||
}
|
||||
Some(Yanked::Reason(reason)) => {
|
||||
writeln!(
|
||||
printer.stderr(),
|
||||
"{}{} {dist} is yanked (reason: \"{reason}\").",
|
||||
"warning".yellow().bold(),
|
||||
":".bold(),
|
||||
)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue