Recursively resolve direct URL references upfront#2684
Merged
charliermarsh merged 2 commits intomainfrom Apr 1, 2024
Merged
Conversation
943ad05 to
d1c557e
Compare
aa6470e to
5a07fda
Compare
charliermarsh
commented
Mar 27, 2024
charliermarsh
commented
Mar 27, 2024
5a07fda to
89a18f7
Compare
charliermarsh
commented
Mar 27, 2024
fd40f0b to
d5c5a09
Compare
Member
|
Sweet! I tested this on an old version of packse which has git dependencies. |
charliermarsh
added a commit
that referenced
this pull request
Mar 28, 2024
## Summary This is a trimmed-down version of #2684 that only applies to local source trees for now, which enables workspace-like workflows (whereby local packages can depend on other local packages at arbitrary depth). Closes #2699. ## Test Plan Added new tests. Also cloned this MRE that was shared with me (https://github.com/timothyjlaurent/uv-poetry-monorepo-mre), and verified that it was installed without error: ``` ❯ cargo run pip install ./uv-poetry-monorepo-mre/app --no-cache Finished dev [unoptimized + debuginfo] target(s) in 0.15s Running `target/debug/uv pip install ./uv-poetry-monorepo-mre/app --no-cache` Resolved 4 packages in 1.28s Built app @ file:///Users/crmarsh/workspace/uv/uv-poetry-monorepo-mre/app Built lib1 @ file:///Users/crmarsh/workspace/uv/uv-poetry-monorepo-mre/lib1 Built lib2 @ file:///Users/crmarsh/workspace/uv/uv-poetry-monorepo-mre/lib2 Downloaded 4 packages in 457ms Installed 4 packages in 2ms + app==0.1.0 (from file:///Users/crmarsh/workspace/uv/uv-poetry-monorepo-mre/app) + lib1==0.1.0 (from file:///Users/crmarsh/workspace/uv/uv-poetry-monorepo-mre/lib1) + lib2==0.1.0 (from file:///Users/crmarsh/workspace/uv/uv-poetry-monorepo-mre/lib2) + ruff==0.3.4 ```
26bfa87 to
c62c6cc
Compare
Member
Author
|
This PR lifts a significant limitation (transitive URL dependencies) at the cost of some parallelism (we have to build and resolve them all upfront). |
Member
|
It's only going to be a performance degradation for cases where the user previously had to enumerate all the URLs, correct? |
Member
Author
|
That seems fair, yes. There are two issues:
|
Member
|
Did you do any benches? Worth it? The behavior seems worth enabling regardless. |
Member
Author
|
Yeah my guess is that it's pretty rare to have nested URL dependencies anyway, and in the cases that you do, users would definitely prefer that they work even if there's a performance hit. |
Member
Author
|
I think I need to update docs before merging though. |
c62c6cc to
be3735c
Compare
be3735c to
3b2728a
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR would enable us to support transitive URL requirements. The key idea is to leverage the fact that...
Prior to running the "real" resolver, we recursively resolve any URL requirements, and collect all the known URLs upfront, then pass those to the resolver as "lookahead" requirements. This means the resolver knows upfront that if a given package is included, it must use the provided URL.
Closes #1808.