Avoid enforcing distribution ID uniqueness for extras (#4104)

## Summary

The condition enforced here isn't quite right. The same dependency can
appear multiple times, as long as the extra is different.

Closes https://github.com/astral-sh/uv/issues/4101.
This commit is contained in:
Charlie Marsh 2024-06-06 11:21:31 -04:00 committed by GitHub
parent 8798e91dd5
commit 30e73a60de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 296 additions and 2 deletions

View file

@ -340,7 +340,7 @@ impl TryFrom<LockWire> for Lock {
dist.dependencies.sort();
for windows in dist.dependencies.windows(2) {
let (dep1, dep2) = (&windows[0], &windows[1]);
if dep1.id == dep2.id {
if dep1 == dep2 {
return Err(LockError::duplicate_dependency(
dist.id.clone(),
dep1.id.clone(),