Refactor storage of distribution metadata needed in resolver (#1291)

Follows #1290 and https://github.com/astral-sh/puffin/pull/912 with some
minor clean-up.
This commit is contained in:
Zanie Blue 2024-02-12 22:19:21 -06:00 committed by GitHub
parent 3bff8d5f79
commit 7fec2a311a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 75 additions and 83 deletions

View file

@ -78,10 +78,6 @@ impl VersionMap {
}
}
// It is possible for files to have a different yank status per PEP 592 but in the official
// PyPI warehouse this cannot happen.
// If any file is yanked, the version will be marked as yanked.
// <https://peps.python.org/pep-0592/#warehouse-pypi-implementation-notes>
let yanked = if let Some(ref yanked) = file.yanked {
yanked.clone()
} else {
@ -115,9 +111,9 @@ impl VersionMap {
priority_dist.insert_built(
dist,
requires_python,
yanked,
Some(hash),
priority,
yanked,
);
}
DistFilename::SourceDistFilename(filename) => {
@ -126,7 +122,7 @@ impl VersionMap {
file,
index.clone(),
);
priority_dist.insert_source(dist, requires_python, Some(hash), yanked);
priority_dist.insert_source(dist, requires_python, yanked, Some(hash));
}
}
}