375f76e...
by
Charlie Marsh <email address hidden>
Merge branch 'main' into zb/site-packages-link
8507ba8...
by
Charlie Marsh <email address hidden>
Remove unnecessary hashing from IDs (#2998)
## Summary
In all of these ID types, we pass values to `cache_key::digest` prior to
passing to `DistributionId` or `ResourceId`. The `DistributionId` and
`ResourceId` are then hashed later, since they're used as keys in hash
maps.
It seems wasteful to hash the value, then hash the hashed value? So this
PR modifies those structs to be enums that can take one of a fixed set
of types.
a71bd60...
by
Charlie Marsh <email address hidden>
Allow unnamed requirements for overrides (#2999)
## Summary
This PR lifts a constraint by allowing unnamed requirements in
`overrides.txt` files.
0d62e62...
by
Charlie Marsh <email address hidden>
Make hash-checking failure mode stricter and safer (#2997)
## Summary
If there are no hashes for a given package, we now return
`Validate(&[])` so that the policy is impossible to satisfy. Previously,
we returned `None`, which is always satisfied.
We don't really ever expect to hit this, because we detect this case in
the resolver and raise a different error. But if we have a bug
somewhere, it's better to fail with an error than silently let the
package through.
9d5467d...
by
Charlie Marsh <email address hidden>
Remove outdated comment on `IndexLocations` (#2996)
8e5a40e...
by
Charlie Marsh <email address hidden>
Add additional coverage for `--require-hashes` in `install` (#2994)
96c3c2e...
by
Charlie Marsh <email address hidden>
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.
d56d142...
by
Charlie Marsh <email address hidden>
Add a few more `--generate-hashes` cases to compile tests (#2992)
When running the `uv-client` tests, i would previously get:
```
warning: field `0` is never read
--> crates/uv-configuration/src/config_settings.rs:43:27
|
43 | pub struct ConfigSettings(BTreeMap<String, ConfigSettingValue>);
| -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| field in this struct
|
= note: `ConfigSettings` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
43 | pub struct ConfigSettings(());
| ~~