mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08: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
|
@ -72,3 +72,14 @@ impl From<DistFile> for File {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Deref for DistFile {
|
||||
type Target = File;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
match self {
|
||||
DistFile::Wheel(file) => &file.0,
|
||||
DistFile::Sdist(file) => &file.0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -551,6 +551,12 @@ impl<'a, Context: BuildContext + Sync> Resolver<'a, Context> {
|
|||
{
|
||||
continue;
|
||||
}
|
||||
// When resolving, exclude yanked files. TODO(konstin): When we fail
|
||||
// resolving due to a dependency locked to yanked version, we should tell
|
||||
// the user.
|
||||
if file.yanked.is_yanked() {
|
||||
continue;
|
||||
}
|
||||
if let Ok(filename) = WheelFilename::from_str(file.filename.as_str()) {
|
||||
if filename.is_compatible(self.tags) {
|
||||
let version = PubGrubVersion::from(filename.version.clone());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue