uv/crates/uv-dev
Charlie Marsh 006379c50c
Add support for URL requirements in --generate-hashes (#2952)
## Summary

This PR enables hash generation for URL requirements when the user
provides `--generate-hashes` to `pip compile`. While we include the
hashes from the registry already, today, we omit hashes for URLs.

To power hash generation, we introduce a `HashPolicy` abstraction:

```rust
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum HashPolicy<'a> {
    /// No hash policy is specified.
    None,
    /// Hashes should be generated (specifically, a SHA-256 hash), but not validated.
    Generate,
    /// Hashes should be validated against a pre-defined list of hashes. If necessary, hashes should
    /// be generated so as to ensure that the archive is valid.
    Validate(&'a [HashDigest]),
}
```

All of the methods on the distribution database now accept this policy,
instead of accepting `&'a [HashDigest]`.

Closes #2378.
2024-04-10 20:02:45 +00:00
..
src Add support for URL requirements in --generate-hashes (#2952) 2024-04-10 20:02:45 +00:00
.gitignore Rename to uv (#1302) 2024-02-15 11:19:46 -06:00
builder.dockerfile Rename to uv (#1302) 2024-02-15 11:19:46 -06:00
Cargo.toml Remove unused task-local-extensions dependency (#2974) 2024-04-10 14:56:39 -04:00
test_sdist_building.sh Rename to uv (#1302) 2024-02-15 11:19:46 -06:00