mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-01 20:31:12 +00:00
Allow prereleases, locals, and URLs in non-editable path requirements (#2671)
## Summary This PR enables the resolver to "accept" URLs, prereleases, and local version specifiers for direct dependencies of path dependencies. As a result, `uv pip install .` and `uv pip install -e .` now behave identically, in that neither has a restriction on URL dependencies and the like. Closes https://github.com/astral-sh/uv/issues/2643. Closes https://github.com/astral-sh/uv/issues/1853.
This commit is contained in:
parent
4b69ad4281
commit
cf30932831
17 changed files with 484 additions and 77 deletions
|
|
@ -41,11 +41,16 @@ impl ResolutionStrategy {
|
|||
ResolutionMode::Highest => Self::Highest,
|
||||
ResolutionMode::Lowest => Self::Lowest,
|
||||
ResolutionMode::LowestDirect => Self::LowestDirect(
|
||||
// Consider `requirements` and dependencies of `editables` to be "direct" dependencies.
|
||||
// Consider `requirements` and dependencies of any local requirements to be "direct" dependencies.
|
||||
manifest
|
||||
.requirements
|
||||
.iter()
|
||||
.filter(|requirement| requirement.evaluate_markers(markers, &[]))
|
||||
.chain(manifest.lookaheads.iter().flat_map(|lookahead| {
|
||||
lookahead.requirements().iter().filter(|requirement| {
|
||||
requirement.evaluate_markers(markers, lookahead.extras())
|
||||
})
|
||||
}))
|
||||
.chain(manifest.editables.iter().flat_map(|(editable, metadata)| {
|
||||
metadata.requires_dist.iter().filter(|requirement| {
|
||||
requirement.evaluate_markers(markers, &editable.extras)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue