-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Resolver
in pip sync
#2696
Use Resolver
in pip sync
#2696
Conversation
@@ -66,7 +64,6 @@ enum Cli { | |||
/// cargo run --bin uv-dev -- resolve-many scripts/popular_packages/pypi_10k_most_dependents.txt | |||
/// ``` | |||
ResolveMany(ResolveManyArgs), | |||
InstallMany(InstallManyArgs), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does anyone care about preserving this? I can migrate it but I wasn't sure if it was worth it. \cc @konstin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been annoyed maintaining it since I don't use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was nice to have but honestly not if its effort to maintain, i don't run it anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha. If I had my way I would remove them all.
8b95e1c
to
21bf287
Compare
error: Network connectivity is disabled, but the requested data wasn't found in the cache for: `black` | ||
error: Because black==23.10.1 was not found in the cache and you require black==23.10.1, we can conclude that the requirements are unsatisfiable. | ||
|
||
hint: Packages were unavailable because the network was disabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an improvement, I think.
error: markupsafe isn't available locally, but making network requests to registries was banned. | ||
error: Because markupsafe==2.1.3 was not found in the provided package locations and you require markupsafe==2.1.3, we can conclude that the requirements are unsatisfiable. | ||
|
||
hint: Packages were unavailable because index lookups were disabled and no additional package locations were provided (try: `--find-links <uri>`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an improvement, I think.
@@ -584,7 +584,7 @@ fn install_git_tag() -> Result<()> { | |||
Resolved 1 package in [TIME] | |||
Downloaded 1 package in [TIME] | |||
Installed 1 package in [TIME] | |||
+ werkzeug==2.0.0 (from git+https://github.com/pallets/werkzeug.git@2.0.0) | |||
+ werkzeug==2.0.0 (from git+https://github.com/pallets/werkzeug.git@af160e0b6b7ddd81c22f1652c728ff5ac72d5c74) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an improvement, I think.
@@ -1801,7 +1803,7 @@ fn install_url_built_dist_cached() -> Result<()> { | |||
----- stdout ----- | |||
|
|||
----- stderr ----- | |||
Removed 2 files for tqdm ([SIZE]) | |||
Removed 3 files for tqdm ([SIZE]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why this changed. Will look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have an additional .msgpack
file from the cache, because we fetch the Requires-Python
for the URL.
/// | ||
/// TODO(charlie): This currently passes, but should fail. `sync` does not currently validate the | ||
/// `Requires-Python` constraint for direct URL dependencies. (It _does_ respect `Requires-Python` | ||
/// for registry-based dependencies.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was #2443.
21bf287
to
bc30872
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me. Will have conflicts with #2596, we'll need to add support for local site packages to pip sync
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow.
bc30872
to
061956e
Compare
Summary
This PR removes the custom
DistFinder
that we use inpip sync
. This originally existed becauseVersionMap
wasn't lazy, and so we saved a lot of time inDistFinder
by reading distribution data lazily. But now, AFAICT, there's really no benefit. MaintainingDistFinder
means we effectively have to maintain two resolvers, and end up fixing bugs inDistFinder
that don't exist in theResolver
(like #2688.Closes #2694.
Closes #2443.
Test Plan
I ran this benchmark a bunch. It's basically a wash. Sometimes one is faster than the other.