mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-03 13:14:41 +00:00
Return computed hashes from metadata requests (#2951)
## Summary This PR modifies the distribution database to return both the `Metadata23` and the computed hashes when clients request metadata. No behavior changes, but this will be necessary to power `--generate-hashes`.
This commit is contained in:
parent
c18551fd3c
commit
8513d603b4
9 changed files with 100 additions and 60 deletions
|
|
@ -4,6 +4,7 @@ pub use download::LocalWheel;
|
|||
pub use error::Error;
|
||||
pub use git::{is_same_reference, to_precise};
|
||||
pub use index::{BuiltWheelIndex, RegistryWheelIndex};
|
||||
use pypi_types::{HashDigest, Metadata23};
|
||||
pub use reporter::Reporter;
|
||||
pub use source::SourceDistributionBuilder;
|
||||
|
||||
|
|
@ -16,3 +17,21 @@ mod index;
|
|||
mod locks;
|
||||
mod reporter;
|
||||
mod source;
|
||||
|
||||
/// The metadata associated with an archive.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ArchiveMetadata {
|
||||
/// The [`Metadata23`] for the underlying distribution.
|
||||
pub metadata: Metadata23,
|
||||
/// The hashes of the source or built archive.
|
||||
pub hashes: Vec<HashDigest>,
|
||||
}
|
||||
|
||||
impl From<Metadata23> for ArchiveMetadata {
|
||||
fn from(metadata: Metadata23) -> Self {
|
||||
Self {
|
||||
metadata,
|
||||
hashes: vec![],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue