-
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 compile
selects old version; different behavior between install vs. compile
#6209
Comments
Oh, I just noticed that I can make $ uv pip install numpy numba
Resolved 4 packages in 18ms
Building llvmlite==0.34.0
Building numba==0.51.2
⠹ Preparing packages...
[...] Also, this means re-ordering the $ cat oof3.in
numba
numpy
$ uv pip compile oof3.in
Resolved 3 packages in 12ms
# This file was autogenerated by uv via the following command:
# uv pip compile oof3.in
llvmlite==0.43.0
# via numba
numba==0.60.0
# via -r oof3.in
numpy==2.0.1
# via
# -r oof3.in
# numba |
As a point of comparison, plain |
See also #5474 (comment) |
I think your question regarding the effect of ordering is answered there. I'm not sure about why |
Yeah, same venv, same Python version etc. I think that was because the order in the |
Yeah I can see how the resolution being order-dependent can be confusing — but it also gives users more control over resolution and we do need to solve with some ordering. We can document that more clearly though? |
True.
Thanks, that would be helpful. Probably at least in https://github.com/astral-sh/uv/blob/main/PIP_COMPATIBILITY.md ? |
Yeah — I'll do that. Thanks! |
This isn't correct... The order of requirements does affect the priority for pip, it's just pip has more heuristics on resolving than uv, so there are some cases like this one where the heuristics pip has means the output doesn't change on input orders. |
re, this was discussed here too: numba/numba#9708 (comment) Also, @notatallshaw there seems to be some disagreement about |
You can look at the bottom of this page for a (only slightly outdated) look at pip's resolution priority order: https://pip.pypa.io/en/stable/topics/more-dependency-resolution/#the-resolver-algorithm Although, I should update those docs, they are mostly correct, but I plan to land some big changes to pip over the next couple of release, I will remember to update them as I do. Also I'm writing a PR to improve uv's pip compatibility docs on this #6619, I'm going to significantly reword it though based on Charlie's feedback once I get a chance to look. I'll take a look at your issue this evening and see if I can help provide any clarity. |
Consider the following scenario:
For some reason,
numba==0.51.2
is selected, even thoughnumba==0.60.0
exists (probably becausenumba==0.60.0
requiresnumpy <2.1
?). The selected version ofllvmlite
does not install on modern (>3.8
) Python versions.By constraining
numba
to a current version, a more recent compatible version is selected:Installation works:
Note that this is a reduction of a failure of
uv pip install
intox-uv
, which I could not reproduce as easily -uv pip install numba numpy
selects the currentnumba
version. See for example this CI log for details. It could also be that this issue is just me holding things wrong, or a bug innumba
ornumpy
?Verbose output: `uv pip compile oof.in -v`
The text was updated successfully, but these errors were encountered: