Split resolver.rs into a module (#752)

This is just getting hard to navigate. No code changes, just moving
stuff around.
This commit is contained in:
Charlie Marsh 2024-01-03 15:02:30 -04:00 committed by GitHub
parent 48c7359622
commit a8e52d2899
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 226 additions and 187 deletions

View file

@ -0,0 +1,26 @@
use url::Url;
use distribution_types::{IndexUrl, PackageId};
use pep440_rs::VersionSpecifiers;
use puffin_normalize::PackageName;
use puffin_traits::OnceMap;
use pypi_types::{BaseUrl, Metadata21};
use crate::version_map::VersionMap;
/// In-memory index of package metadata.
#[derive(Default)]
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)>,
/// A map from package ID to metadata for that distribution.
pub(crate) distributions: OnceMap<PackageId, Metadata21>,
/// A map from package ID to required Python version.
pub(crate) incompatibilities: OnceMap<PackageId, VersionSpecifiers>,
/// A map from source URL to precise URL.
pub(crate) redirects: OnceMap<Url, Url>,
}