-
Notifications
You must be signed in to change notification settings - Fork 1k
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
uv pip install --require-hashes
fails when (transitive) dependencies aren't pinned to latest version
#10425
Comments
I meant to also add the
Other mentions of urllib3:
So the puzzle here is how |
Is this the entire
|
No, I linked to a gist with the entire requirements.txt file as pasting huge blobs of text into issues distracts from the narrative. |
Thanks! Missed it. |
Thanks for the quick resolution on this @charliermarsh :) |
## Summary This PR reverts #10441 and applies a different fix for #10425. In #10441, I changed prioritization to visit proxies eagerly. I think this is actually wrong, since it means we prioritize proxy packages above _everything_ else. And while a proxy only depends on itself, it does mean we're selecting a _version_ for the proxy package earlier than anything else. So, if you look at #10828, we end up choosing a version for `async-timeout` before we choose a version for `langchain`, despite the latter being a first-party dependency. (`async-timeout` has a marker on it, so it has a proxy package, so we solve for it first.) To fix #10425, we instead need to make sure we visit proxies in the order we see them. I think the virtual tiebreaker for proxies is reversed? We want to visit the package we see first, first. So, in short: this reverts #10441, then corrects the ordering for visiting proxies. Closes #10828.
uv version 0.5.16
Description
When I
uv pip install --require-hashes -r requirements.txt
I get:But my
requirements.txt
does specify a version and hashes forurllib3
:This doesn't happen if I have a
requirements.txt
that pins tourllib3==2.3.0
, which is the latest version.Hypothesis
The dependency solver is trying to pull in the latest version of
urllib3
rather than the version pinned inrequirements.txt
, and (obviously) not finding pinning (or hashes) for that version.How I got here (reproduction)
I start out with a
pyproject.toml
:Then generate a poetry.lock file with
poetry lock
. Inside that I can see:NB I'm using poetry 2.0.0 here as it respects PEP 621. I've also recreated this with poetry 1.8.2, but the pyproject.toml needs to use the old style [tool.poetry] rather than [project].
Then generate a requirements.txt from the poetry.lock with
poetry export --output requirements.txt
, which contains:Finally ask uv to install from that requirements.txt with --require-hashes
uv pip install --require-hashes -r requirements.txt
Python 3.8 is deprecated
Yes, I know, if I specify
requires-python = ">=3.9"
then I get a poetry.lock and requirements.txt that use urllib3==2.3.0Whilst using 3.8 seems to be what surfaced this issue for me I don't think it's the fundamental cause.
The text was updated successfully, but these errors were encountered: