-
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
is uv pip sync with --find-links broken? #2688
Comments
I feel like the space probably is indicative of what's going wrong, but I don't see how that could be happening. Can you upload the exact requirements file? |
I made you a small MRE that replicates the issue on my side, see the README.md for instructions. |
Thank you! |
Okay, running on |
By the way, removing |
## Summary In `pip sync`, we weren't properly handling cases in which a package _only_ existed in `--find-links` (e.g., the user passed `--offline` or `--no-index`). I plan to explore removing `Finder` entirely to avoid these mismatch bugs between `pip sync` and other commands, but this is fine for now. Closes #2688. ## Test Plan `cargo test`
Thanks for the great MRE! Fixed in the next release. |
Thanks a lot! Just a quick check: does it work without —no-index because it finds the local library, or is there a lib1 on PyPI mirroring the local library and is the problem therefore masked? |
It finds both (like pip), but it correctly selects the local library since you pinned the version (in my testing). |
## Summary This PR removes the custom `DistFinder` that we use in `pip sync`. This originally existed because `VersionMap` wasn't lazy, and so we saved a lot of time in `DistFinder` by reading distribution data lazily. But now, AFAICT, there's really no benefit. Maintaining `DistFinder` means we effectively have to maintain two resolvers, and end up fixing bugs in `DistFinder` that don't exist in the `Resolver` (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. ``` ❯ python -m scripts.bench \ --uv-path ./target/release/main \ --uv-path ./target/release/uv \ scripts/requirements/compiled/trio.txt --min-runs 50 --benchmark install-warm --warmup 25 Benchmark 1: ./target/release/main (install-warm) Time (mean ± σ): 54.0 ms ± 10.6 ms [User: 8.7 ms, System: 98.1 ms] Range (min … max): 45.5 ms … 94.3 ms 50 runs Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet PC without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. Benchmark 2: ./target/release/uv (install-warm) Time (mean ± σ): 50.7 ms ± 9.2 ms [User: 8.7 ms, System: 98.6 ms] Range (min … max): 44.0 ms … 98.6 ms 50 runs Warning: The first benchmarking run for this command was significantly slower than the rest (77.6 ms). This could be caused by (filesystem) caches that were not filled until after the first run. You should consider using the '--warmup' option to fill those caches before the actual benchmark. Alternatively, use the '--prepare' option to clear the caches before each timing run. Summary './target/release/uv (install-warm)' ran 1.06 ± 0.29 times faster than './target/release/main (install-warm)' ```
uv version: 0.1.24, running on MacOS.
In my use case, I want to install dependencies, some of them living as .whl files in a local directory. When running `uv pip sync ... -find-links LOCAL_PATH the whls were not found. I made a small example that reproduces the case for me, with disabled network lookup to simplify the case
Case 1: uv pip install seems to work correctly
uv -v pip install MY_PACKAGE --find-links /Users/OTHER_STUFF/libraries/.wheels --no-index
result: based on the logs, it clearly finds the package (and only starts failing later, as this package has external dependencies which it is now blocked to fetch due to no-index flag). Snippet from the log:
Case 2: uv pip sync seems to fail
uv -v pip sync requirements-dev2.txt --find-links /Users/OTHER_STUFF/libraries/.wheels --no-index
content of the requirements file:
MY_PACKAGE==0.0.1
Snippet from the log:
Note: there actually is a whitespace in
DEBUG Identified uncached requirement: MY_PACKAGE ==0.0.1
. Could this be a pointer to what is wrong?I also tried
pip-sync
for case 2 instead ofuv pip sync
, which also seems to work.The text was updated successfully, but these errors were encountered: