mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-02 06:51:14 +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,7 +1020,37 @@ async fn install(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::items_after_statements)]
|
// 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(
|
fn report_dry_run(
|
||||||
resolution: &Resolution,
|
resolution: &Resolution,
|
||||||
plan: Plan,
|
plan: Plan,
|
||||||
|
@ -1149,36 +1179,6 @@ async fn install(
|
||||||
Ok(())
|
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(())
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Validate the installed packages in the virtual environment.
|
/// Validate the installed packages in the virtual environment.
|
||||||
fn validate(
|
fn validate(
|
||||||
resolution: &Resolution,
|
resolution: &Resolution,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue