mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Show yank warnings for pip install
(#1253)
Closes https://github.com/astral-sh/puffin/issues/1252.
This commit is contained in:
parent
d090acf13d
commit
398659a9b0
1 changed files with 28 additions and 0 deletions
|
@ -30,6 +30,7 @@ use puffin_resolver::{
|
|||
ResolutionGraph, ResolutionMode, Resolver,
|
||||
};
|
||||
use puffin_traits::{InFlight, SetupPyStrategy};
|
||||
use pypi_types::Yanked;
|
||||
use requirements_txt::EditableRequirement;
|
||||
|
||||
use crate::commands::reporters::{DownloadReporter, InstallReporter, ResolverReporter};
|
||||
|
@ -525,6 +526,33 @@ async fn install(
|
|||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// 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,
|
||||
"{}{} {dist} is yanked.",
|
||||
"warning".yellow().bold(),
|
||||
":".bold(),
|
||||
)?;
|
||||
}
|
||||
Some(Yanked::Reason(reason)) => {
|
||||
writeln!(
|
||||
printer,
|
||||
"{}{} {dist} is yanked (reason: \"{reason}\").",
|
||||
"warning".yellow().bold(),
|
||||
":".bold(),
|
||||
)?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Download, build, and unzip any missing distributions.
|
||||
let wheels = if remote.is_empty() {
|
||||
vec![]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue