mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Support unnamed requirements in --require-hashes
(#2993)
## Summary This PR enables `--require-hashes` with unnamed requirements. The key change is that `PackageId` becomes `VersionId` (since it refers to a package at a specific version), and the new `PackageId` consists of _either_ a package name _or_ a URL. The hashes are keyed by `PackageId`, so we can generate the `RequiredHashes` before we have names for all packages, and enforce them throughout. Closes #2979.
This commit is contained in:
parent
d56d142520
commit
96c3c2e774
25 changed files with 256 additions and 185 deletions
|
@ -3,7 +3,7 @@ use std::future::Future;
|
|||
use anyhow::Result;
|
||||
use chrono::{DateTime, Utc};
|
||||
|
||||
use distribution_types::{Dist, IndexLocations, Name};
|
||||
use distribution_types::{Dist, IndexLocations};
|
||||
use platform_tags::Tags;
|
||||
|
||||
use uv_client::RegistryClient;
|
||||
|
@ -181,7 +181,7 @@ impl<'a, Context: BuildContext + Send + Sync> ResolverProvider
|
|||
async fn get_or_build_wheel_metadata<'io>(&'io self, dist: &'io Dist) -> WheelMetadataResult {
|
||||
match self
|
||||
.fetcher
|
||||
.get_or_build_wheel_metadata(dist, self.hasher.get(dist.name()))
|
||||
.get_or_build_wheel_metadata(dist, self.hasher.get(dist))
|
||||
.await
|
||||
{
|
||||
Ok(metadata) => Ok(MetadataResponse::Found(metadata)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue