-
Notifications
You must be signed in to change notification settings - Fork 778
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
uv-resolver: support unambiguous omission of 'source' and 'version'
When there is only one distribution for a particular package name, any dependencies (the edges in the resolution graph) that reference that package name are completely unambiguous. Therefore, we can actually omit their version and source information and instead derive it from the distribution entry. We add some tests to check the success and error cases. That is, when `source` or `version` are omitted and there are more than one corresponding distribution for the package name (i.e., it's ambiguous), then lock deserialization should fail.
- Loading branch information
1 parent
4cb1595
commit 4accbfd
Showing
7 changed files
with
944 additions
and
18 deletions.
There are no files selected for viewing
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
...resolver/src/snapshots/uv_resolver__lock__tests__missing_dependency_source_ambiguous.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: "dependency a has missing `source` field but has more than one matching distribution", | ||
raw: None, | ||
keys: [], | ||
span: None, | ||
}, | ||
}, | ||
}, | ||
) |
Oops, something went wrong.