mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-24 05:35:04 +00:00
Filter out yanked files (#413)
Implement two behaviors for yanked versions: * During `pip-compile`, yanked versions are filtered out entirely, we currently treat them is if they don't exist. This is leads to confusing error messages because a version that does exist seems to have suddenly disappeared. * During `pip-sync`, we warn when we fetch a remote distribution and it has been yanked. We currently don't warn on cached or installed distributions that have been yanked.
This commit is contained in:
parent
28ec4e79f0
commit
bacf1dc911
9 changed files with 158 additions and 16 deletions
|
@ -1,7 +1,7 @@
|
|||
pub use direct_url::{ArchiveInfo, DirectUrl, VcsInfo, VcsKind};
|
||||
pub use lenient_requirement::LenientVersionSpecifiers;
|
||||
pub use metadata::{Error, Metadata21};
|
||||
pub use simple_json::{File, SimpleJson};
|
||||
pub use simple_json::{File, SimpleJson, Yanked};
|
||||
|
||||
mod direct_url;
|
||||
mod lenient_requirement;
|
||||
|
|
|
@ -66,6 +66,15 @@ pub enum Yanked {
|
|||
Reason(String),
|
||||
}
|
||||
|
||||
impl Yanked {
|
||||
pub fn is_yanked(&self) -> bool {
|
||||
match self {
|
||||
Yanked::Bool(is_yanked) => *is_yanked,
|
||||
Yanked::Reason(_) => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Hashes {
|
||||
pub sha256: String,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue