-
Notifications
You must be signed in to change notification settings - Fork 710
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This only makes hashes optional for wheels/sdists that come from registires or direct URLs. For wheels/sdists that come from other sources, a hash should not be present. For path dependencies, a hash should not be present because the state of the path dependency is not intended to be tracked in the lock file. This is consistent with how other tools deal with path dependencies, and if it were otherwise, the hash would I believe need to be updated for every change to the path dependency. For git dependencies (source dists only), a hash should not be present because the lock will contain the specific commit revision hash. This is functionally equivalent to a hash, and so a hash is redundant. As part of this change, we validate the presence or absence of a hash based on the dependency source. We also add our first regression tests.
- Loading branch information
1 parent
76a39c7
commit 616ed53
Showing
5 changed files
with
175 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
crates/uv-resolver/src/snapshots/uv_resolver__lock__tests__hash_required_missing.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
source: crates/uv-resolver/src/lock.rs | ||
expression: result | ||
--- | ||
Err( | ||
Error { | ||
inner: Error { | ||
inner: TomlError { | ||
message: "since the distribution `anyio 4.3.0 path+file:///foo/bar` comes from a path dependency, a hash was not expected but one was found for wheel", | ||
raw: None, | ||
keys: [], | ||
span: None, | ||
}, | ||
}, | ||
}, | ||
) |
16 changes: 16 additions & 0 deletions
16
crates/uv-resolver/src/snapshots/uv_resolver__lock__tests__hash_required_present.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
source: crates/uv-resolver/src/lock.rs | ||
expression: result | ||
--- | ||
Err( | ||
Error { | ||
inner: Error { | ||
inner: TomlError { | ||
message: "since the distribution `anyio 4.3.0 registry+https://pypi.org/simple` comes from a registry dependency, a hash was expected but one was not found for wheel", | ||
raw: None, | ||
keys: [], | ||
span: None, | ||
}, | ||
}, | ||
}, | ||
) |