mirror of
https://github.com/astral-sh/uv.git
synced 2025-09-26 20:19:08 +00:00
Rename MetadataResolver
to ResolutionMetadata
(#7661)
This commit is contained in:
parent
16a6fd2c42
commit
5da73a24cb
12 changed files with 78 additions and 73 deletions
|
@ -1,6 +1,6 @@
|
||||||
use pep440_rs::{Version, VersionSpecifiers};
|
use pep440_rs::{Version, VersionSpecifiers};
|
||||||
use pep508_rs::Requirement;
|
use pep508_rs::Requirement;
|
||||||
use pypi_types::{MetadataResolver, VerbatimParsedUrl};
|
use pypi_types::{ResolutionMetadata, VerbatimParsedUrl};
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use uv_normalize::{ExtraName, PackageName};
|
use uv_normalize::{ExtraName, PackageName};
|
||||||
|
@ -20,7 +20,7 @@ impl DependencyMetadata {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Retrieve a [`StaticMetadata`] entry by [`PackageName`] and [`Version`].
|
/// Retrieve a [`StaticMetadata`] entry by [`PackageName`] and [`Version`].
|
||||||
pub fn get(&self, package: &PackageName, version: &Version) -> Option<MetadataResolver> {
|
pub fn get(&self, package: &PackageName, version: &Version) -> Option<ResolutionMetadata> {
|
||||||
let versions = self.0.get(package)?;
|
let versions = self.0.get(package)?;
|
||||||
|
|
||||||
// Search for an exact, then a global match.
|
// Search for an exact, then a global match.
|
||||||
|
@ -29,7 +29,7 @@ impl DependencyMetadata {
|
||||||
.find(|v| v.version.as_ref() == Some(version))
|
.find(|v| v.version.as_ref() == Some(version))
|
||||||
.or_else(|| versions.iter().find(|v| v.version.is_none()))?;
|
.or_else(|| versions.iter().find(|v| v.version.is_none()))?;
|
||||||
|
|
||||||
Some(MetadataResolver {
|
Some(ResolutionMetadata {
|
||||||
name: metadata.name.clone(),
|
name: metadata.name.clone(),
|
||||||
version: version.clone(),
|
version: version.clone(),
|
||||||
requires_dist: metadata.requires_dist.clone(),
|
requires_dist: metadata.requires_dist.clone(),
|
||||||
|
|
|
@ -285,13 +285,13 @@ impl InstalledDist {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read the `METADATA` file from a `.dist-info` directory.
|
/// Read the `METADATA` file from a `.dist-info` directory.
|
||||||
pub fn metadata(&self) -> Result<pypi_types::MetadataResolver> {
|
pub fn metadata(&self) -> Result<pypi_types::ResolutionMetadata> {
|
||||||
match self {
|
match self {
|
||||||
Self::Registry(_) | Self::Url(_) => {
|
Self::Registry(_) | Self::Url(_) => {
|
||||||
let path = self.path().join("METADATA");
|
let path = self.path().join("METADATA");
|
||||||
let contents = fs::read(&path)?;
|
let contents = fs::read(&path)?;
|
||||||
// TODO(zanieb): Update this to use thiserror so we can unpack parse errors downstream
|
// TODO(zanieb): Update this to use thiserror so we can unpack parse errors downstream
|
||||||
pypi_types::MetadataResolver::parse_metadata(&contents).with_context(|| {
|
pypi_types::ResolutionMetadata::parse_metadata(&contents).with_context(|| {
|
||||||
format!(
|
format!(
|
||||||
"Failed to parse `METADATA` file at: {}",
|
"Failed to parse `METADATA` file at: {}",
|
||||||
path.user_display()
|
path.user_display()
|
||||||
|
@ -306,7 +306,7 @@ impl InstalledDist {
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
let contents = fs::read(path.as_ref())?;
|
let contents = fs::read(path.as_ref())?;
|
||||||
pypi_types::MetadataResolver::parse_metadata(&contents).with_context(|| {
|
pypi_types::ResolutionMetadata::parse_metadata(&contents).with_context(|| {
|
||||||
format!(
|
format!(
|
||||||
"Failed to parse `PKG-INFO` file at: {}",
|
"Failed to parse `PKG-INFO` file at: {}",
|
||||||
path.user_display()
|
path.user_display()
|
||||||
|
|
|
@ -21,7 +21,7 @@ use crate::{metadata, LenientVersionSpecifiers, MetadataError, VerbatimParsedUrl
|
||||||
/// Core Metadata 2.3 is specified in <https://packaging.python.org/specifications/core-metadata/>.
|
/// Core Metadata 2.3 is specified in <https://packaging.python.org/specifications/core-metadata/>.
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
#[serde(rename_all = "kebab-case")]
|
#[serde(rename_all = "kebab-case")]
|
||||||
pub struct MetadataResolver {
|
pub struct ResolutionMetadata {
|
||||||
// Mandatory fields
|
// Mandatory fields
|
||||||
pub name: PackageName,
|
pub name: PackageName,
|
||||||
pub version: Version,
|
pub version: Version,
|
||||||
|
@ -32,8 +32,8 @@ pub struct MetadataResolver {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// From <https://github.com/PyO3/python-pkginfo-rs/blob/d719988323a0cfea86d4737116d7917f30e819e2/src/metadata.rs#LL78C2-L91C26>
|
/// From <https://github.com/PyO3/python-pkginfo-rs/blob/d719988323a0cfea86d4737116d7917f30e819e2/src/metadata.rs#LL78C2-L91C26>
|
||||||
impl MetadataResolver {
|
impl ResolutionMetadata {
|
||||||
/// Parse the [`MetadataResolver`] from a `METADATA` file, as included in a built distribution (wheel).
|
/// Parse the [`ResolutionMetadata`] from a `METADATA` file, as included in a built distribution (wheel).
|
||||||
pub fn parse_metadata(content: &[u8]) -> Result<Self, MetadataError> {
|
pub fn parse_metadata(content: &[u8]) -> Result<Self, MetadataError> {
|
||||||
let headers = Headers::parse(content)?;
|
let headers = Headers::parse(content)?;
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ impl MetadataResolver {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read the [`MetadataResolver`] from a source distribution's `PKG-INFO` file, if it uses Metadata 2.2
|
/// Read the [`ResolutionMetadata`] from a source distribution's `PKG-INFO` file, if it uses Metadata 2.2
|
||||||
/// or later _and_ none of the required fields (`Requires-Python`, `Requires-Dist`, and
|
/// or later _and_ none of the required fields (`Requires-Python`, `Requires-Dist`, and
|
||||||
/// `Provides-Extra`) are marked as dynamic.
|
/// `Provides-Extra`) are marked as dynamic.
|
||||||
pub fn parse_pkg_info(content: &[u8]) -> Result<Self, MetadataError> {
|
pub fn parse_pkg_info(content: &[u8]) -> Result<Self, MetadataError> {
|
||||||
|
@ -167,61 +167,61 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parse_metadata() {
|
fn test_parse_metadata() {
|
||||||
let s = "Metadata-Version: 1.0";
|
let s = "Metadata-Version: 1.0";
|
||||||
let meta = MetadataResolver::parse_metadata(s.as_bytes());
|
let meta = ResolutionMetadata::parse_metadata(s.as_bytes());
|
||||||
assert!(matches!(meta, Err(MetadataError::FieldNotFound("Name"))));
|
assert!(matches!(meta, Err(MetadataError::FieldNotFound("Name"))));
|
||||||
|
|
||||||
let s = "Metadata-Version: 1.0\nName: asdf";
|
let s = "Metadata-Version: 1.0\nName: asdf";
|
||||||
let meta = MetadataResolver::parse_metadata(s.as_bytes());
|
let meta = ResolutionMetadata::parse_metadata(s.as_bytes());
|
||||||
assert!(matches!(meta, Err(MetadataError::FieldNotFound("Version"))));
|
assert!(matches!(meta, Err(MetadataError::FieldNotFound("Version"))));
|
||||||
|
|
||||||
let s = "Metadata-Version: 1.0\nName: asdf\nVersion: 1.0";
|
let s = "Metadata-Version: 1.0\nName: asdf\nVersion: 1.0";
|
||||||
let meta = MetadataResolver::parse_metadata(s.as_bytes()).unwrap();
|
let meta = ResolutionMetadata::parse_metadata(s.as_bytes()).unwrap();
|
||||||
assert_eq!(meta.name, PackageName::from_str("asdf").unwrap());
|
assert_eq!(meta.name, PackageName::from_str("asdf").unwrap());
|
||||||
assert_eq!(meta.version, Version::new([1, 0]));
|
assert_eq!(meta.version, Version::new([1, 0]));
|
||||||
|
|
||||||
let s = "Metadata-Version: 1.0\nName: asdf\nVersion: 1.0\nAuthor: 中文\n\n一个 Python 包";
|
let s = "Metadata-Version: 1.0\nName: asdf\nVersion: 1.0\nAuthor: 中文\n\n一个 Python 包";
|
||||||
let meta = MetadataResolver::parse_metadata(s.as_bytes()).unwrap();
|
let meta = ResolutionMetadata::parse_metadata(s.as_bytes()).unwrap();
|
||||||
assert_eq!(meta.name, PackageName::from_str("asdf").unwrap());
|
assert_eq!(meta.name, PackageName::from_str("asdf").unwrap());
|
||||||
assert_eq!(meta.version, Version::new([1, 0]));
|
assert_eq!(meta.version, Version::new([1, 0]));
|
||||||
|
|
||||||
let s = "Metadata-Version: 1.0\nName: =?utf-8?q?foobar?=\nVersion: 1.0";
|
let s = "Metadata-Version: 1.0\nName: =?utf-8?q?foobar?=\nVersion: 1.0";
|
||||||
let meta = MetadataResolver::parse_metadata(s.as_bytes()).unwrap();
|
let meta = ResolutionMetadata::parse_metadata(s.as_bytes()).unwrap();
|
||||||
assert_eq!(meta.name, PackageName::from_str("foobar").unwrap());
|
assert_eq!(meta.name, PackageName::from_str("foobar").unwrap());
|
||||||
assert_eq!(meta.version, Version::new([1, 0]));
|
assert_eq!(meta.version, Version::new([1, 0]));
|
||||||
|
|
||||||
let s = "Metadata-Version: 1.0\nName: =?utf-8?q?=C3=A4_space?= <x@y.org>\nVersion: 1.0";
|
let s = "Metadata-Version: 1.0\nName: =?utf-8?q?=C3=A4_space?= <x@y.org>\nVersion: 1.0";
|
||||||
let meta = MetadataResolver::parse_metadata(s.as_bytes());
|
let meta = ResolutionMetadata::parse_metadata(s.as_bytes());
|
||||||
assert!(matches!(meta, Err(MetadataError::InvalidName(_))));
|
assert!(matches!(meta, Err(MetadataError::InvalidName(_))));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parse_pkg_info() {
|
fn test_parse_pkg_info() {
|
||||||
let s = "Metadata-Version: 2.1";
|
let s = "Metadata-Version: 2.1";
|
||||||
let meta = MetadataResolver::parse_pkg_info(s.as_bytes());
|
let meta = ResolutionMetadata::parse_pkg_info(s.as_bytes());
|
||||||
assert!(matches!(
|
assert!(matches!(
|
||||||
meta,
|
meta,
|
||||||
Err(MetadataError::UnsupportedMetadataVersion(_))
|
Err(MetadataError::UnsupportedMetadataVersion(_))
|
||||||
));
|
));
|
||||||
|
|
||||||
let s = "Metadata-Version: 2.2\nName: asdf";
|
let s = "Metadata-Version: 2.2\nName: asdf";
|
||||||
let meta = MetadataResolver::parse_pkg_info(s.as_bytes());
|
let meta = ResolutionMetadata::parse_pkg_info(s.as_bytes());
|
||||||
assert!(matches!(meta, Err(MetadataError::FieldNotFound("Version"))));
|
assert!(matches!(meta, Err(MetadataError::FieldNotFound("Version"))));
|
||||||
|
|
||||||
let s = "Metadata-Version: 2.3\nName: asdf";
|
let s = "Metadata-Version: 2.3\nName: asdf";
|
||||||
let meta = MetadataResolver::parse_pkg_info(s.as_bytes());
|
let meta = ResolutionMetadata::parse_pkg_info(s.as_bytes());
|
||||||
assert!(matches!(meta, Err(MetadataError::FieldNotFound("Version"))));
|
assert!(matches!(meta, Err(MetadataError::FieldNotFound("Version"))));
|
||||||
|
|
||||||
let s = "Metadata-Version: 2.3\nName: asdf\nVersion: 1.0";
|
let s = "Metadata-Version: 2.3\nName: asdf\nVersion: 1.0";
|
||||||
let meta = MetadataResolver::parse_pkg_info(s.as_bytes()).unwrap();
|
let meta = ResolutionMetadata::parse_pkg_info(s.as_bytes()).unwrap();
|
||||||
assert_eq!(meta.name, PackageName::from_str("asdf").unwrap());
|
assert_eq!(meta.name, PackageName::from_str("asdf").unwrap());
|
||||||
assert_eq!(meta.version, Version::new([1, 0]));
|
assert_eq!(meta.version, Version::new([1, 0]));
|
||||||
|
|
||||||
let s = "Metadata-Version: 2.3\nName: asdf\nVersion: 1.0\nDynamic: Requires-Dist";
|
let s = "Metadata-Version: 2.3\nName: asdf\nVersion: 1.0\nDynamic: Requires-Dist";
|
||||||
let meta = MetadataResolver::parse_pkg_info(s.as_bytes()).unwrap_err();
|
let meta = ResolutionMetadata::parse_pkg_info(s.as_bytes()).unwrap_err();
|
||||||
assert!(matches!(meta, MetadataError::DynamicField("Requires-Dist")));
|
assert!(matches!(meta, MetadataError::DynamicField("Requires-Dist")));
|
||||||
|
|
||||||
let s = "Metadata-Version: 2.3\nName: asdf\nVersion: 1.0\nRequires-Dist: foo";
|
let s = "Metadata-Version: 2.3\nName: asdf\nVersion: 1.0\nRequires-Dist: foo";
|
||||||
let meta = MetadataResolver::parse_pkg_info(s.as_bytes()).unwrap();
|
let meta = ResolutionMetadata::parse_pkg_info(s.as_bytes()).unwrap();
|
||||||
assert_eq!(meta.name, PackageName::from_str("asdf").unwrap());
|
assert_eq!(meta.name, PackageName::from_str("asdf").unwrap());
|
||||||
assert_eq!(meta.version, Version::new([1, 0]));
|
assert_eq!(meta.version, Version::new([1, 0]));
|
||||||
assert_eq!(meta.requires_dist, vec!["foo".parse().unwrap()]);
|
assert_eq!(meta.requires_dist, vec!["foo".parse().unwrap()]);
|
||||||
|
|
|
@ -16,7 +16,7 @@ use uv_normalize::InvalidNameError;
|
||||||
pub use metadata10::Metadata10;
|
pub use metadata10::Metadata10;
|
||||||
pub use metadata12::Metadata12;
|
pub use metadata12::Metadata12;
|
||||||
pub use metadata23::Metadata23;
|
pub use metadata23::Metadata23;
|
||||||
pub use metadata_resolver::MetadataResolver;
|
pub use metadata_resolver::ResolutionMetadata;
|
||||||
pub use pyproject_toml::RequiresDist;
|
pub use pyproject_toml::RequiresDist;
|
||||||
pub use requires_txt::RequiresTxt;
|
pub use requires_txt::RequiresTxt;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
LenientRequirement, LenientVersionSpecifiers, MetadataError, MetadataResolver,
|
LenientRequirement, LenientVersionSpecifiers, MetadataError, ResolutionMetadata,
|
||||||
VerbatimParsedUrl,
|
VerbatimParsedUrl,
|
||||||
};
|
};
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
|
@ -12,7 +12,7 @@ use std::str::FromStr;
|
||||||
use uv_normalize::{ExtraName, PackageName};
|
use uv_normalize::{ExtraName, PackageName};
|
||||||
|
|
||||||
/// Extract the metadata from a `pyproject.toml` file, as specified in PEP 621.
|
/// Extract the metadata from a `pyproject.toml` file, as specified in PEP 621.
|
||||||
pub(crate) fn parse_pyproject_toml(contents: &str) -> Result<MetadataResolver, MetadataError> {
|
pub(crate) fn parse_pyproject_toml(contents: &str) -> Result<ResolutionMetadata, MetadataError> {
|
||||||
let pyproject_toml = PyProjectToml::from_toml(contents)?;
|
let pyproject_toml = PyProjectToml::from_toml(contents)?;
|
||||||
|
|
||||||
let project = pyproject_toml
|
let project = pyproject_toml
|
||||||
|
@ -77,7 +77,7 @@ pub(crate) fn parse_pyproject_toml(contents: &str) -> Result<MetadataResolver, M
|
||||||
provides_extras.push(extra);
|
provides_extras.push(extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(MetadataResolver {
|
Ok(ResolutionMetadata {
|
||||||
name,
|
name,
|
||||||
version,
|
version,
|
||||||
requires_dist,
|
requires_dist,
|
||||||
|
@ -149,7 +149,7 @@ struct ToolPoetry {}
|
||||||
/// Python Package Metadata 2.3 as specified in
|
/// Python Package Metadata 2.3 as specified in
|
||||||
/// <https://packaging.python.org/specifications/core-metadata/>.
|
/// <https://packaging.python.org/specifications/core-metadata/>.
|
||||||
///
|
///
|
||||||
/// This is a subset of [`MetadataResolver`]; specifically, it omits the `version` and `requires-python`
|
/// This is a subset of [`ResolutionMetadata`]; specifically, it omits the `version` and `requires-python`
|
||||||
/// fields, which aren't necessary when extracting the requirements of a package without installing
|
/// fields, which aren't necessary when extracting the requirements of a package without installing
|
||||||
/// the package itself.
|
/// the package itself.
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
|
|
@ -11,7 +11,7 @@ use tracing::debug;
|
||||||
|
|
||||||
pub use archive::ArchiveId;
|
pub use archive::ArchiveId;
|
||||||
use distribution_types::InstalledDist;
|
use distribution_types::InstalledDist;
|
||||||
use pypi_types::MetadataResolver;
|
use pypi_types::ResolutionMetadata;
|
||||||
use uv_cache_info::Timestamp;
|
use uv_cache_info::Timestamp;
|
||||||
use uv_fs::{cachedir, directories};
|
use uv_fs::{cachedir, directories};
|
||||||
use uv_normalize::PackageName;
|
use uv_normalize::PackageName;
|
||||||
|
@ -789,7 +789,7 @@ impl CacheBucket {
|
||||||
let Ok(metadata) = fs_err::read(path.join("metadata.msgpack")) else {
|
let Ok(metadata) = fs_err::read(path.join("metadata.msgpack")) else {
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
let Ok(metadata) = rmp_serde::from_slice::<MetadataResolver>(&metadata) else {
|
let Ok(metadata) = rmp_serde::from_slice::<ResolutionMetadata>(&metadata) else {
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
metadata.name == *name
|
metadata.name == *name
|
||||||
|
|
|
@ -19,7 +19,7 @@ use distribution_types::{
|
||||||
use pep440_rs::Version;
|
use pep440_rs::Version;
|
||||||
use pep508_rs::MarkerEnvironment;
|
use pep508_rs::MarkerEnvironment;
|
||||||
use platform_tags::Platform;
|
use platform_tags::Platform;
|
||||||
use pypi_types::{MetadataResolver, SimpleJson};
|
use pypi_types::{ResolutionMetadata, SimpleJson};
|
||||||
use uv_cache::{Cache, CacheBucket, CacheEntry, WheelCache};
|
use uv_cache::{Cache, CacheBucket, CacheEntry, WheelCache};
|
||||||
use uv_configuration::KeyringProviderType;
|
use uv_configuration::KeyringProviderType;
|
||||||
use uv_configuration::{IndexStrategy, TrustedHost};
|
use uv_configuration::{IndexStrategy, TrustedHost};
|
||||||
|
@ -405,7 +405,7 @@ impl RegistryClient {
|
||||||
&self,
|
&self,
|
||||||
built_dist: &BuiltDist,
|
built_dist: &BuiltDist,
|
||||||
capabilities: &IndexCapabilities,
|
capabilities: &IndexCapabilities,
|
||||||
) -> Result<MetadataResolver, Error> {
|
) -> Result<ResolutionMetadata, Error> {
|
||||||
let metadata = match &built_dist {
|
let metadata = match &built_dist {
|
||||||
BuiltDist::Registry(wheels) => {
|
BuiltDist::Registry(wheels) => {
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
@ -455,7 +455,7 @@ impl RegistryClient {
|
||||||
.map_err(|err| {
|
.map_err(|err| {
|
||||||
ErrorKind::Metadata(path.to_string_lossy().to_string(), err)
|
ErrorKind::Metadata(path.to_string_lossy().to_string(), err)
|
||||||
})?;
|
})?;
|
||||||
MetadataResolver::parse_metadata(&contents).map_err(|err| {
|
ResolutionMetadata::parse_metadata(&contents).map_err(|err| {
|
||||||
ErrorKind::MetadataParseError(
|
ErrorKind::MetadataParseError(
|
||||||
wheel.filename.clone(),
|
wheel.filename.clone(),
|
||||||
built_dist.to_string(),
|
built_dist.to_string(),
|
||||||
|
@ -489,7 +489,7 @@ impl RegistryClient {
|
||||||
.map_err(|err| {
|
.map_err(|err| {
|
||||||
ErrorKind::Metadata(wheel.install_path.to_string_lossy().to_string(), err)
|
ErrorKind::Metadata(wheel.install_path.to_string_lossy().to_string(), err)
|
||||||
})?;
|
})?;
|
||||||
MetadataResolver::parse_metadata(&contents).map_err(|err| {
|
ResolutionMetadata::parse_metadata(&contents).map_err(|err| {
|
||||||
ErrorKind::MetadataParseError(
|
ErrorKind::MetadataParseError(
|
||||||
wheel.filename.clone(),
|
wheel.filename.clone(),
|
||||||
built_dist.to_string(),
|
built_dist.to_string(),
|
||||||
|
@ -516,7 +516,7 @@ impl RegistryClient {
|
||||||
file: &File,
|
file: &File,
|
||||||
url: &Url,
|
url: &Url,
|
||||||
capabilities: &IndexCapabilities,
|
capabilities: &IndexCapabilities,
|
||||||
) -> Result<MetadataResolver, Error> {
|
) -> Result<ResolutionMetadata, Error> {
|
||||||
// If the metadata file is available at its own url (PEP 658), download it from there.
|
// If the metadata file is available at its own url (PEP 658), download it from there.
|
||||||
let filename = WheelFilename::from_str(&file.filename).map_err(ErrorKind::WheelFilename)?;
|
let filename = WheelFilename::from_str(&file.filename).map_err(ErrorKind::WheelFilename)?;
|
||||||
if file.dist_info_metadata {
|
if file.dist_info_metadata {
|
||||||
|
@ -541,7 +541,7 @@ impl RegistryClient {
|
||||||
let bytes = response.bytes().await.map_err(ErrorKind::from)?;
|
let bytes = response.bytes().await.map_err(ErrorKind::from)?;
|
||||||
|
|
||||||
info_span!("parse_metadata21")
|
info_span!("parse_metadata21")
|
||||||
.in_scope(|| MetadataResolver::parse_metadata(bytes.as_ref()))
|
.in_scope(|| ResolutionMetadata::parse_metadata(bytes.as_ref()))
|
||||||
.map_err(|err| {
|
.map_err(|err| {
|
||||||
Error::from(ErrorKind::MetadataParseError(
|
Error::from(ErrorKind::MetadataParseError(
|
||||||
filename,
|
filename,
|
||||||
|
@ -582,7 +582,7 @@ impl RegistryClient {
|
||||||
index: Option<&'data IndexUrl>,
|
index: Option<&'data IndexUrl>,
|
||||||
cache_shard: WheelCache<'data>,
|
cache_shard: WheelCache<'data>,
|
||||||
capabilities: &'data IndexCapabilities,
|
capabilities: &'data IndexCapabilities,
|
||||||
) -> Result<MetadataResolver, Error> {
|
) -> Result<ResolutionMetadata, Error> {
|
||||||
let cache_entry = self.cache.entry(
|
let cache_entry = self.cache.entry(
|
||||||
CacheBucket::Wheels,
|
CacheBucket::Wheels,
|
||||||
cache_shard.wheel_dir(filename.name.as_ref()),
|
cache_shard.wheel_dir(filename.name.as_ref()),
|
||||||
|
@ -630,14 +630,14 @@ impl RegistryClient {
|
||||||
trace!("Getting metadata for {filename} by range request");
|
trace!("Getting metadata for {filename} by range request");
|
||||||
let text = wheel_metadata_from_remote_zip(filename, url, &mut reader).await?;
|
let text = wheel_metadata_from_remote_zip(filename, url, &mut reader).await?;
|
||||||
let metadata =
|
let metadata =
|
||||||
MetadataResolver::parse_metadata(text.as_bytes()).map_err(|err| {
|
ResolutionMetadata::parse_metadata(text.as_bytes()).map_err(|err| {
|
||||||
Error::from(ErrorKind::MetadataParseError(
|
Error::from(ErrorKind::MetadataParseError(
|
||||||
filename.clone(),
|
filename.clone(),
|
||||||
url.to_string(),
|
url.to_string(),
|
||||||
Box::new(err),
|
Box::new(err),
|
||||||
))
|
))
|
||||||
})?;
|
})?;
|
||||||
Ok::<MetadataResolver, CachedClientError<Error>>(metadata)
|
Ok::<ResolutionMetadata, CachedClientError<Error>>(metadata)
|
||||||
}
|
}
|
||||||
.boxed_local()
|
.boxed_local()
|
||||||
.instrument(info_span!("read_metadata_range_request", wheel = %filename))
|
.instrument(info_span!("read_metadata_range_request", wheel = %filename))
|
||||||
|
|
|
@ -3,7 +3,7 @@ use std::path::{Path, PathBuf};
|
||||||
use crate::Error;
|
use crate::Error;
|
||||||
use distribution_filename::WheelFilename;
|
use distribution_filename::WheelFilename;
|
||||||
use distribution_types::{CachedDist, Dist, Hashed};
|
use distribution_types::{CachedDist, Dist, Hashed};
|
||||||
use pypi_types::{HashDigest, MetadataResolver};
|
use pypi_types::{HashDigest, ResolutionMetadata};
|
||||||
use uv_metadata::read_flat_wheel_metadata;
|
use uv_metadata::read_flat_wheel_metadata;
|
||||||
|
|
||||||
use uv_cache_info::CacheInfo;
|
use uv_cache_info::CacheInfo;
|
||||||
|
@ -40,8 +40,8 @@ impl LocalWheel {
|
||||||
&self.filename
|
&self.filename
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read the [`MetadataResolver`] from a wheel.
|
/// Read the [`ResolutionMetadata`] from a wheel.
|
||||||
pub fn metadata(&self) -> Result<MetadataResolver, Error> {
|
pub fn metadata(&self) -> Result<ResolutionMetadata, Error> {
|
||||||
read_flat_wheel_metadata(&self.filename, &self.archive)
|
read_flat_wheel_metadata(&self.filename, &self.archive)
|
||||||
.map_err(|err| Error::WheelMetadata(self.archive.clone(), Box::new(err)))
|
.map_err(|err| Error::WheelMetadata(self.archive.clone(), Box::new(err)))
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ use std::path::Path;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
use pep440_rs::{Version, VersionSpecifiers};
|
use pep440_rs::{Version, VersionSpecifiers};
|
||||||
use pypi_types::{HashDigest, MetadataResolver};
|
use pypi_types::{HashDigest, ResolutionMetadata};
|
||||||
use uv_configuration::SourceStrategy;
|
use uv_configuration::SourceStrategy;
|
||||||
use uv_normalize::{ExtraName, GroupName, PackageName};
|
use uv_normalize::{ExtraName, GroupName, PackageName};
|
||||||
use uv_workspace::WorkspaceError;
|
use uv_workspace::WorkspaceError;
|
||||||
|
@ -39,7 +39,7 @@ pub struct Metadata {
|
||||||
impl Metadata {
|
impl Metadata {
|
||||||
/// Lower without considering `tool.uv` in `pyproject.toml`, used for index and other archive
|
/// Lower without considering `tool.uv` in `pyproject.toml`, used for index and other archive
|
||||||
/// dependencies.
|
/// dependencies.
|
||||||
pub fn from_metadata23(metadata: MetadataResolver) -> Self {
|
pub fn from_metadata23(metadata: ResolutionMetadata) -> Self {
|
||||||
Self {
|
Self {
|
||||||
name: metadata.name,
|
name: metadata.name,
|
||||||
version: metadata.version,
|
version: metadata.version,
|
||||||
|
@ -57,7 +57,7 @@ impl Metadata {
|
||||||
/// Lower by considering `tool.uv` in `pyproject.toml` if present, used for Git and directory
|
/// Lower by considering `tool.uv` in `pyproject.toml` if present, used for Git and directory
|
||||||
/// dependencies.
|
/// dependencies.
|
||||||
pub async fn from_workspace(
|
pub async fn from_workspace(
|
||||||
metadata: MetadataResolver,
|
metadata: ResolutionMetadata,
|
||||||
install_path: &Path,
|
install_path: &Path,
|
||||||
sources: SourceStrategy,
|
sources: SourceStrategy,
|
||||||
) -> Result<Self, MetadataError> {
|
) -> Result<Self, MetadataError> {
|
||||||
|
@ -102,7 +102,7 @@ pub struct ArchiveMetadata {
|
||||||
impl ArchiveMetadata {
|
impl ArchiveMetadata {
|
||||||
/// Lower without considering `tool.uv` in `pyproject.toml`, used for index and other archive
|
/// Lower without considering `tool.uv` in `pyproject.toml`, used for index and other archive
|
||||||
/// dependencies.
|
/// dependencies.
|
||||||
pub fn from_metadata23(metadata: MetadataResolver) -> Self {
|
pub fn from_metadata23(metadata: ResolutionMetadata) -> Self {
|
||||||
Self {
|
Self {
|
||||||
metadata: Metadata::from_metadata23(metadata),
|
metadata: Metadata::from_metadata23(metadata),
|
||||||
hashes: vec![],
|
hashes: vec![],
|
||||||
|
|
|
@ -20,7 +20,7 @@ use distribution_types::{
|
||||||
use fs_err::tokio as fs;
|
use fs_err::tokio as fs;
|
||||||
use futures::{FutureExt, TryStreamExt};
|
use futures::{FutureExt, TryStreamExt};
|
||||||
use platform_tags::Tags;
|
use platform_tags::Tags;
|
||||||
use pypi_types::{HashDigest, Metadata12, MetadataResolver, RequiresTxt};
|
use pypi_types::{HashDigest, Metadata12, RequiresTxt, ResolutionMetadata};
|
||||||
use reqwest::Response;
|
use reqwest::Response;
|
||||||
use tokio_util::compat::FuturesAsyncReadCompatExt;
|
use tokio_util::compat::FuturesAsyncReadCompatExt;
|
||||||
use tracing::{debug, info_span, instrument, warn, Instrument};
|
use tracing::{debug, info_span, instrument, warn, Instrument};
|
||||||
|
@ -1583,7 +1583,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
||||||
source_root: &Path,
|
source_root: &Path,
|
||||||
subdirectory: Option<&Path>,
|
subdirectory: Option<&Path>,
|
||||||
cache_shard: &CacheShard,
|
cache_shard: &CacheShard,
|
||||||
) -> Result<(String, WheelFilename, MetadataResolver), Error> {
|
) -> Result<(String, WheelFilename, ResolutionMetadata), Error> {
|
||||||
debug!("Building: {source}");
|
debug!("Building: {source}");
|
||||||
|
|
||||||
// Guard against build of source distributions when disabled.
|
// Guard against build of source distributions when disabled.
|
||||||
|
@ -1641,7 +1641,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
||||||
source: &BuildableSource<'_>,
|
source: &BuildableSource<'_>,
|
||||||
source_root: &Path,
|
source_root: &Path,
|
||||||
subdirectory: Option<&Path>,
|
subdirectory: Option<&Path>,
|
||||||
) -> Result<Option<MetadataResolver>, Error> {
|
) -> Result<Option<ResolutionMetadata>, Error> {
|
||||||
debug!("Preparing metadata for: {source}");
|
debug!("Preparing metadata for: {source}");
|
||||||
|
|
||||||
// Set up the builder.
|
// Set up the builder.
|
||||||
|
@ -1673,7 +1673,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
||||||
let content = fs::read(dist_info.join("METADATA"))
|
let content = fs::read(dist_info.join("METADATA"))
|
||||||
.await
|
.await
|
||||||
.map_err(Error::CacheRead)?;
|
.map_err(Error::CacheRead)?;
|
||||||
let metadata = MetadataResolver::parse_metadata(&content)?;
|
let metadata = ResolutionMetadata::parse_metadata(&content)?;
|
||||||
|
|
||||||
// Validate the metadata.
|
// Validate the metadata.
|
||||||
validate(source, &metadata)?;
|
validate(source, &metadata)?;
|
||||||
|
@ -1685,7 +1685,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
||||||
source: &BuildableSource<'_>,
|
source: &BuildableSource<'_>,
|
||||||
source_root: &Path,
|
source_root: &Path,
|
||||||
subdirectory: Option<&Path>,
|
subdirectory: Option<&Path>,
|
||||||
) -> Result<Option<MetadataResolver>, Error> {
|
) -> Result<Option<ResolutionMetadata>, Error> {
|
||||||
// Attempt to read static metadata from the `pyproject.toml`.
|
// Attempt to read static metadata from the `pyproject.toml`.
|
||||||
match read_pyproject_toml(source_root, subdirectory).await {
|
match read_pyproject_toml(source_root, subdirectory).await {
|
||||||
Ok(metadata) => {
|
Ok(metadata) => {
|
||||||
|
@ -1858,7 +1858,7 @@ pub fn prune(cache: &Cache) -> Result<Removal, Error> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Validate that the source distribution matches the built metadata.
|
/// Validate that the source distribution matches the built metadata.
|
||||||
fn validate(source: &BuildableSource<'_>, metadata: &MetadataResolver) -> Result<(), Error> {
|
fn validate(source: &BuildableSource<'_>, metadata: &ResolutionMetadata) -> Result<(), Error> {
|
||||||
if let Some(name) = source.name() {
|
if let Some(name) = source.name() {
|
||||||
if metadata.name != *name {
|
if metadata.name != *name {
|
||||||
return Err(Error::NameMismatch {
|
return Err(Error::NameMismatch {
|
||||||
|
@ -1955,7 +1955,7 @@ impl LocalRevisionPointer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read the [`MetadataResolver`] by combining a source distribution's `PKG-INFO` file with a
|
/// Read the [`ResolutionMetadata`] by combining a source distribution's `PKG-INFO` file with a
|
||||||
/// `requires.txt`.
|
/// `requires.txt`.
|
||||||
///
|
///
|
||||||
/// `requires.txt` is a legacy concept from setuptools. For example, here's
|
/// `requires.txt` is a legacy concept from setuptools. For example, here's
|
||||||
|
@ -1988,7 +1988,7 @@ impl LocalRevisionPointer {
|
||||||
async fn read_egg_info(
|
async fn read_egg_info(
|
||||||
source_tree: &Path,
|
source_tree: &Path,
|
||||||
subdirectory: Option<&Path>,
|
subdirectory: Option<&Path>,
|
||||||
) -> Result<MetadataResolver, Error> {
|
) -> Result<ResolutionMetadata, Error> {
|
||||||
fn find_egg_info(source_tree: &Path) -> std::io::Result<Option<PathBuf>> {
|
fn find_egg_info(source_tree: &Path) -> std::io::Result<Option<PathBuf>> {
|
||||||
for entry in fs_err::read_dir(source_tree)? {
|
for entry in fs_err::read_dir(source_tree)? {
|
||||||
let entry = entry?;
|
let entry = entry?;
|
||||||
|
@ -2048,7 +2048,7 @@ async fn read_egg_info(
|
||||||
let metadata = Metadata12::parse_metadata(&content).map_err(Error::PkgInfo)?;
|
let metadata = Metadata12::parse_metadata(&content).map_err(Error::PkgInfo)?;
|
||||||
|
|
||||||
// Combine the sources.
|
// Combine the sources.
|
||||||
Ok(MetadataResolver {
|
Ok(ResolutionMetadata {
|
||||||
name: metadata.name,
|
name: metadata.name,
|
||||||
version: metadata.version,
|
version: metadata.version,
|
||||||
requires_python: metadata.requires_python,
|
requires_python: metadata.requires_python,
|
||||||
|
@ -2057,13 +2057,13 @@ async fn read_egg_info(
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read the [`MetadataResolver`] from a source distribution's `PKG-INFO` file, if it uses Metadata 2.2
|
/// Read the [`ResolutionMetadata`] from a source distribution's `PKG-INFO` file, if it uses Metadata 2.2
|
||||||
/// or later _and_ none of the required fields (`Requires-Python`, `Requires-Dist`, and
|
/// or later _and_ none of the required fields (`Requires-Python`, `Requires-Dist`, and
|
||||||
/// `Provides-Extra`) are marked as dynamic.
|
/// `Provides-Extra`) are marked as dynamic.
|
||||||
async fn read_pkg_info(
|
async fn read_pkg_info(
|
||||||
source_tree: &Path,
|
source_tree: &Path,
|
||||||
subdirectory: Option<&Path>,
|
subdirectory: Option<&Path>,
|
||||||
) -> Result<MetadataResolver, Error> {
|
) -> Result<ResolutionMetadata, Error> {
|
||||||
// Read the `PKG-INFO` file.
|
// Read the `PKG-INFO` file.
|
||||||
let pkg_info = match subdirectory {
|
let pkg_info = match subdirectory {
|
||||||
Some(subdirectory) => source_tree.join(subdirectory).join("PKG-INFO"),
|
Some(subdirectory) => source_tree.join(subdirectory).join("PKG-INFO"),
|
||||||
|
@ -2078,17 +2078,17 @@ async fn read_pkg_info(
|
||||||
};
|
};
|
||||||
|
|
||||||
// Parse the metadata.
|
// Parse the metadata.
|
||||||
let metadata = MetadataResolver::parse_pkg_info(&content).map_err(Error::PkgInfo)?;
|
let metadata = ResolutionMetadata::parse_pkg_info(&content).map_err(Error::PkgInfo)?;
|
||||||
|
|
||||||
Ok(metadata)
|
Ok(metadata)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read the [`MetadataResolver`] from a source distribution's `pyproject.toml` file, if it defines static
|
/// Read the [`ResolutionMetadata`] from a source distribution's `pyproject.toml` file, if it defines static
|
||||||
/// metadata consistent with PEP 621.
|
/// metadata consistent with PEP 621.
|
||||||
async fn read_pyproject_toml(
|
async fn read_pyproject_toml(
|
||||||
source_tree: &Path,
|
source_tree: &Path,
|
||||||
subdirectory: Option<&Path>,
|
subdirectory: Option<&Path>,
|
||||||
) -> Result<MetadataResolver, Error> {
|
) -> Result<ResolutionMetadata, Error> {
|
||||||
// Read the `pyproject.toml` file.
|
// Read the `pyproject.toml` file.
|
||||||
let pyproject_toml = match subdirectory {
|
let pyproject_toml = match subdirectory {
|
||||||
Some(subdirectory) => source_tree.join(subdirectory).join("pyproject.toml"),
|
Some(subdirectory) => source_tree.join(subdirectory).join("pyproject.toml"),
|
||||||
|
@ -2104,7 +2104,7 @@ async fn read_pyproject_toml(
|
||||||
|
|
||||||
// Parse the metadata.
|
// Parse the metadata.
|
||||||
let metadata =
|
let metadata =
|
||||||
MetadataResolver::parse_pyproject_toml(&content).map_err(Error::PyprojectToml)?;
|
ResolutionMetadata::parse_pyproject_toml(&content).map_err(Error::PyprojectToml)?;
|
||||||
|
|
||||||
Ok(metadata)
|
Ok(metadata)
|
||||||
}
|
}
|
||||||
|
@ -2128,8 +2128,10 @@ async fn read_requires_dist(project_root: &Path) -> Result<pypi_types::RequiresD
|
||||||
Ok(requires_dist)
|
Ok(requires_dist)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read an existing cached [`MetadataResolver`], if it exists.
|
/// Read an existing cached [`ResolutionMetadata`], if it exists.
|
||||||
async fn read_cached_metadata(cache_entry: &CacheEntry) -> Result<Option<MetadataResolver>, Error> {
|
async fn read_cached_metadata(
|
||||||
|
cache_entry: &CacheEntry,
|
||||||
|
) -> Result<Option<ResolutionMetadata>, Error> {
|
||||||
match fs::read(&cache_entry.path()).await {
|
match fs::read(&cache_entry.path()).await {
|
||||||
Ok(cached) => Ok(Some(rmp_serde::from_slice(&cached)?)),
|
Ok(cached) => Ok(Some(rmp_serde::from_slice(&cached)?)),
|
||||||
Err(err) if err.kind() == std::io::ErrorKind::NotFound => Ok(None),
|
Err(err) if err.kind() == std::io::ErrorKind::NotFound => Ok(None),
|
||||||
|
@ -2137,14 +2139,17 @@ async fn read_cached_metadata(cache_entry: &CacheEntry) -> Result<Option<Metadat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read the [`MetadataResolver`] from a built wheel.
|
/// Read the [`ResolutionMetadata`] from a built wheel.
|
||||||
fn read_wheel_metadata(filename: &WheelFilename, wheel: &Path) -> Result<MetadataResolver, Error> {
|
fn read_wheel_metadata(
|
||||||
|
filename: &WheelFilename,
|
||||||
|
wheel: &Path,
|
||||||
|
) -> Result<ResolutionMetadata, Error> {
|
||||||
let file = fs_err::File::open(wheel).map_err(Error::CacheRead)?;
|
let file = fs_err::File::open(wheel).map_err(Error::CacheRead)?;
|
||||||
let reader = std::io::BufReader::new(file);
|
let reader = std::io::BufReader::new(file);
|
||||||
let mut archive = ZipArchive::new(reader)?;
|
let mut archive = ZipArchive::new(reader)?;
|
||||||
let dist_info = read_archive_metadata(filename, &mut archive)
|
let dist_info = read_archive_metadata(filename, &mut archive)
|
||||||
.map_err(|err| Error::WheelMetadata(wheel.to_path_buf(), Box::new(err)))?;
|
.map_err(|err| Error::WheelMetadata(wheel.to_path_buf(), Box::new(err)))?;
|
||||||
Ok(MetadataResolver::parse_metadata(&dist_info)?)
|
Ok(ResolutionMetadata::parse_metadata(&dist_info)?)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Apply an advisory lock to a [`CacheShard`] to prevent concurrent builds.
|
/// Apply an advisory lock to a [`CacheShard`] to prevent concurrent builds.
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
//! specification](https://packaging.python.org/en/latest/specifications/core-metadata/).
|
//! specification](https://packaging.python.org/en/latest/specifications/core-metadata/).
|
||||||
|
|
||||||
use distribution_filename::WheelFilename;
|
use distribution_filename::WheelFilename;
|
||||||
use pypi_types::MetadataResolver;
|
use pypi_types::ResolutionMetadata;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::io::{Read, Seek};
|
use std::io::{Read, Seek};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
@ -233,7 +233,7 @@ pub async fn read_metadata_async_stream<R: futures::AsyncRead + Unpin>(
|
||||||
filename: &WheelFilename,
|
filename: &WheelFilename,
|
||||||
debug_path: &str,
|
debug_path: &str,
|
||||||
reader: R,
|
reader: R,
|
||||||
) -> Result<MetadataResolver, Error> {
|
) -> Result<ResolutionMetadata, Error> {
|
||||||
let reader = futures::io::BufReader::with_capacity(128 * 1024, reader);
|
let reader = futures::io::BufReader::with_capacity(128 * 1024, reader);
|
||||||
let mut zip = async_zip::base::read::stream::ZipFileReader::new(reader);
|
let mut zip = async_zip::base::read::stream::ZipFileReader::new(reader);
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ pub async fn read_metadata_async_stream<R: futures::AsyncRead + Unpin>(
|
||||||
let mut contents = Vec::new();
|
let mut contents = Vec::new();
|
||||||
reader.read_to_end(&mut contents).await.unwrap();
|
reader.read_to_end(&mut contents).await.unwrap();
|
||||||
|
|
||||||
let metadata = MetadataResolver::parse_metadata(&contents)
|
let metadata = ResolutionMetadata::parse_metadata(&contents)
|
||||||
.map_err(|err| Error::InvalidMetadata(debug_path.to_string(), Box::new(err)))?;
|
.map_err(|err| Error::InvalidMetadata(debug_path.to_string(), Box::new(err)))?;
|
||||||
return Ok(metadata);
|
return Ok(metadata);
|
||||||
}
|
}
|
||||||
|
@ -259,14 +259,14 @@ pub async fn read_metadata_async_stream<R: futures::AsyncRead + Unpin>(
|
||||||
Err(Error::MissingDistInfo)
|
Err(Error::MissingDistInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read the [`MetadataResolver`] from an unzipped wheel.
|
/// Read the [`ResolutionMetadata`] from an unzipped wheel.
|
||||||
pub fn read_flat_wheel_metadata(
|
pub fn read_flat_wheel_metadata(
|
||||||
filename: &WheelFilename,
|
filename: &WheelFilename,
|
||||||
wheel: impl AsRef<Path>,
|
wheel: impl AsRef<Path>,
|
||||||
) -> Result<MetadataResolver, Error> {
|
) -> Result<ResolutionMetadata, Error> {
|
||||||
let dist_info_prefix = find_flat_dist_info(filename, &wheel)?;
|
let dist_info_prefix = find_flat_dist_info(filename, &wheel)?;
|
||||||
let metadata = read_dist_info_metadata(&dist_info_prefix, &wheel)?;
|
let metadata = read_dist_info_metadata(&dist_info_prefix, &wheel)?;
|
||||||
MetadataResolver::parse_metadata(&metadata).map_err(|err| {
|
ResolutionMetadata::parse_metadata(&metadata).map_err(|err| {
|
||||||
Error::InvalidMetadata(
|
Error::InvalidMetadata(
|
||||||
format!("{dist_info_prefix}.dist-info/METADATA"),
|
format!("{dist_info_prefix}.dist-info/METADATA"),
|
||||||
Box::new(err),
|
Box::new(err),
|
||||||
|
|
|
@ -30,7 +30,7 @@ use locals::Locals;
|
||||||
use pep440_rs::{Version, MIN_VERSION};
|
use pep440_rs::{Version, MIN_VERSION};
|
||||||
use pep508_rs::MarkerTree;
|
use pep508_rs::MarkerTree;
|
||||||
use platform_tags::Tags;
|
use platform_tags::Tags;
|
||||||
use pypi_types::{MetadataResolver, Requirement, VerbatimParsedUrl};
|
use pypi_types::{Requirement, ResolutionMetadata, VerbatimParsedUrl};
|
||||||
pub use resolver_markers::ResolverMarkers;
|
pub use resolver_markers::ResolverMarkers;
|
||||||
pub(crate) use urls::Urls;
|
pub(crate) use urls::Urls;
|
||||||
use uv_configuration::{Constraints, Overrides};
|
use uv_configuration::{Constraints, Overrides};
|
||||||
|
@ -2583,7 +2583,7 @@ enum Response {
|
||||||
/// The returned metadata for an already-installed distribution.
|
/// The returned metadata for an already-installed distribution.
|
||||||
Installed {
|
Installed {
|
||||||
dist: InstalledDist,
|
dist: InstalledDist,
|
||||||
metadata: MetadataResolver,
|
metadata: ResolutionMetadata,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue