Use Dist in VersionMap (#851)

Refactoring split out from find links support: Find links files can be
represented as `Dist`, but not really as `File`, they don't have url nor
hashes.

`DistRequiresPython` is somewhat odd as an in between type.
This commit is contained in:
konsti 2024-01-10 00:14:42 +01:00 committed by GitHub
parent 1203f8f9e8
commit 858d5584cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 158 additions and 200 deletions

View file

@ -1,10 +1,10 @@
use url::Url;
use distribution_types::{IndexUrl, PackageId};
use distribution_types::PackageId;
use pep440_rs::VersionSpecifiers;
use puffin_normalize::PackageName;
use puffin_traits::OnceMap;
use pypi_types::{BaseUrl, Metadata21};
use pypi_types::Metadata21;
use crate::version_map::VersionMap;
@ -13,7 +13,7 @@ use crate::version_map::VersionMap;
pub(crate) struct Index {
/// A map from package name to the metadata for that package and the index where the metadata
/// came from.
pub(crate) packages: OnceMap<PackageName, (IndexUrl, BaseUrl, VersionMap)>,
pub(crate) packages: OnceMap<PackageName, VersionMap>,
/// A map from package ID to metadata for that distribution.
pub(crate) distributions: OnceMap<PackageId, Metadata21>,