mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 02:48:17 +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
|
@ -127,6 +127,34 @@ impl Dist {
|
|||
Self::Source(SourceDist::DirectUrl(DirectUrlSourceDist { name, url }))
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the [`File`] instance, if this dist is from a registry with simple json api support
|
||||
pub fn file(&self) -> Option<&File> {
|
||||
match self {
|
||||
Dist::Built(built) => built.file(),
|
||||
Dist::Source(source) => source.file(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl BuiltDist {
|
||||
/// Returns the [`File`] instance, if this dist is from a registry with simple json api support
|
||||
pub fn file(&self) -> Option<&File> {
|
||||
match self {
|
||||
BuiltDist::Registry(registry) => Some(®istry.file),
|
||||
BuiltDist::DirectUrl(_) => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SourceDist {
|
||||
/// Returns the [`File`] instance, if this dist is from a registry with simple json api support
|
||||
pub fn file(&self) -> Option<&File> {
|
||||
match self {
|
||||
SourceDist::Registry(registry) => Some(®istry.file),
|
||||
SourceDist::DirectUrl(_) | SourceDist::Git(_) => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Metadata for RegistryBuiltDist {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue