Allow URL requirements in editable installs (#1614)

## Summary

If an editable package declares a direct URL requirement, we currently
error since it's not considered an "allowed" requirement. We need to add
those URLs to the allow-list.

Closes https://github.com/astral-sh/uv/issues/1603.
This commit is contained in:
Charlie Marsh 2024-02-17 15:20:23 -05:00 committed by GitHub
parent 8675f66e74
commit 5c4cecaa85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 75 additions and 7 deletions

View file

@ -180,12 +180,17 @@ impl<'a, Provider: ResolverProvider> Resolver<'a, Provider> {
None
}
})
.chain(
manifest
.editables
.iter()
.map(|(editable, _)| editable.raw()),
)
.chain(manifest.editables.iter().flat_map(|(editable, metadata)| {
std::iter::once(editable.raw()).chain(metadata.requires_dist.iter().filter_map(
|req| {
if let Some(pep508_rs::VersionOrUrl::Url(url)) = &req.version_or_url {
Some(url.raw())
} else {
None
}
},
))
}))
.collect();
// Determine the allowed yanked package versions