mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-27 18:36:44 +00:00
26 lines
873 B
Rust
26 lines
873 B
Rust
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>,
|
|
}
|