Skip to content
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

Closed
sk1p opened this issue Aug 19, 2024 · 12 comments · Fixed by #6211
Closed

uv pip compile selects old version; different behavior between install vs. compile #6209

sk1p opened this issue Aug 19, 2024 · 12 comments · Fixed by #6211
Assignees
Labels
duplicate This issue or pull request already exists question Asking for clarification or support

Comments

@sk1p
Copy link

sk1p commented Aug 19, 2024

Consider the following scenario:

$ python --version
Python 3.11.9
$ uv --version
uv 0.2.37
$ cat oof.in 
numpy
numba
$ uv pip compile oof.in 
Resolved 4 packages in 29ms
# This file was autogenerated by uv via the following command:
#    uv pip compile oof.in
llvmlite==0.34.0
    # via numba
numba==0.51.2
    # via -r oof.in
numpy==2.1.0
    # via
    #   -r oof.in
    #   numba
setuptools==72.2.0
    # via numba

For some reason, numba==0.51.2 is selected, even though numba==0.60.0 exists (probably because numba==0.60.0 requires numpy <2.1?). The selected version of llvmlite does not install on modern (>3.8) Python versions.

By constraining numba to a current version, a more recent compatible version is selected:

$ cat oof2.in 
numpy
numba >= 0.60
$ uv pip compile oof2.in 
Resolved 3 packages in 17ms
# This file was autogenerated by uv via the following command:
#    uv pip compile oof2.in
llvmlite==0.43.0
    # via numba
numba==0.60.0
    # via -r oof2.in
numpy==2.0.1
    # via
    #   -r oof2.in
    #   numba

Installation works:

$ uv pip install numba numpy
Resolved 3 packages in 13ms
Installed 2 packages in 23ms
 + numba==0.60.0
 + numpy==2.0.1

Note that this is a reduction of a failure of uv pip install in tox-uv, which I could not reproduce as easily - uv pip install numba numpy selects the current numba 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 in numba or numpy?

Verbose output: `uv pip compile oof.in -v`
DEBUG uv 0.2.37
DEBUG Starting Python discovery for any Python
DEBUG Looking for exact match for request any Python
DEBUG Searching for Python interpreter in system path
DEBUG Found `cpython-3.11.9-linux-x86_64-gnu` at `/home/alex/miniconda/envs/uvdebug2/bin/python3` (conda prefix)
DEBUG Using Python 3.11.9 interpreter at /home/alex/miniconda/envs/uvdebug2/bin/python3 for builds
DEBUG Using request timeout of 30s
DEBUG Solving with installed Python version: 3.11.9
DEBUG Adding direct dependency: numpy*
DEBUG Adding direct dependency: numba*
DEBUG Found fresh response for: https://pypi.org/simple/numba/
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/57/03/2b4245b05b71c0cee667e6a0b51606dfa7f4157c9093d71c6b208385a611/numba-0.60.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata
DEBUG Found fresh response for: https://pypi.org/simple/numpy/
DEBUG Searching for a compatible version of numpy (*)
DEBUG Selecting: numpy==2.1.0 [compatible] (numpy-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/7b/93/831b4c5b4355210827b3de34f539297e1833c39a68c26a8b454d8cf9f5ed/numpy-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
DEBUG Searching for a compatible version of numba (*)
DEBUG Selecting: numba==0.60.0 [compatible] (numba-0.60.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl)
DEBUG Adding transitive dependency for numba==0.60.0: llvmlite>=0.43.0.dev0, <0.44
DEBUG Adding transitive dependency for numba==0.60.0: numpy>=1.22, <2.1
DEBUG Searching for a compatible version of numba (<0.60.0 | >0.60.0)
DEBUG Selecting: numba==0.59.1 [compatible] (numba-0.59.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl)
DEBUG Found fresh response for: https://pypi.org/simple/llvmlite/
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/54/f2/7d1579037643c874fa73516ea84c07e8d30ea347fb1a88c03b198447655d/numba-0.59.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata
DEBUG Adding transitive dependency for numba==0.59.1: llvmlite>=0.42.0.dev0, <0.43
DEBUG Adding transitive dependency for numba==0.59.1: numpy>=1.22, <1.27
DEBUG Searching for a compatible version of numba (<0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Selecting: numba==0.59.0 [compatible] (numba-0.59.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/fc/92/e859a79e7acd8768773df415e6c91844012145933bd09b57f1c569479e13/numba-0.59.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata
DEBUG Adding transitive dependency for numba==0.59.0: llvmlite>=0.42.0.dev0, <0.43
DEBUG Adding transitive dependency for numba==0.59.0: numpy>=1.22, <1.27
DEBUG Searching for a compatible version of numba (<0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Selecting: numba==0.58.1 [compatible] (numba-0.58.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/65/85/72649823bcbfd01820e1c60fa54eb77adb2dba8be921fe6fabdbeb011a88/numba-0.58.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata
DEBUG Adding transitive dependency for numba==0.58.1: llvmlite>=0.41.0.dev0, <0.42
DEBUG Adding transitive dependency for numba==0.58.1: numpy>=1.22, <1.27
DEBUG Searching for a compatible version of numba (<0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Selecting: numba==0.58.0 [compatible] (numba-0.58.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/f7/b6/8800604a3380aa94af830c30839db93077c7fe2812a48ce7d4400d75ba9c/numba-0.58.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/91/a1/cafa9c5490a00fc59d163e3bf3fd48cfbf9845ff134970c4174d4522aa8d/numba-0.57.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/7b/3e/8f185c4c3520a351c6d400c9342a3189aaf87c02a878e81f117f24a4a64e/numba-0.57.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata
DEBUG Prefetching 5 numba versions
DEBUG Adding transitive dependency for numba==0.58.0: llvmlite>=0.41.0.dev0, <0.42
DEBUG Adding transitive dependency for numba==0.58.0: numpy>=1.21, <1.26
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/1a/66/de416cd8364c7e5cba8da9272809676e907e7045cdcb750f6ff5fff70c29/numba-0.56.4-cp310-cp310-macosx_10_14_x86_64.whl.metadata
DEBUG Searching for a compatible version of numba (<0.58.0 | >0.58.0, <0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Selecting: numba==0.57.1 [compatible] (numba-0.57.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/b8/1b/2b2bba63f18b89da7d2a4e884e0800342484aa11dff59598f82c5b278b66/numba-0.56.3-cp310-cp310-macosx_10_14_x86_64.whl.metadata
DEBUG Adding transitive dependency for numba==0.57.1: llvmlite>=0.40.0.dev0, <0.41
DEBUG Adding transitive dependency for numba==0.57.1: numpy>=1.21, <1.25
DEBUG Searching for a compatible version of numba (<0.57.1 | >0.57.1, <0.58.0 | >0.58.0, <0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Selecting: numba==0.57.0 [compatible] (numba-0.57.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl)
DEBUG Adding transitive dependency for numba==0.57.0: llvmlite>=0.40.0.dev0, <0.41
DEBUG Adding transitive dependency for numba==0.57.0: numpy>=1.21, <1.25
DEBUG Searching for a compatible version of numba (<0.57.0 | >0.57.0, <0.57.1 | >0.57.1, <0.58.0 | >0.58.0, <0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Selecting: numba==0.56.4 [compatible] (numba-0.56.4.tar.gz)
DEBUG Adding transitive dependency for numba==0.56.4: llvmlite>=0.39.0.dev0, <0.40
DEBUG Adding transitive dependency for numba==0.56.4: numpy>=1.18, <1.24
DEBUG Adding transitive dependency for numba==0.56.4: setuptools*
DEBUG Searching for a compatible version of numba (<0.56.4 | >0.56.4, <0.57.0 | >0.57.0, <0.57.1 | >0.57.1, <0.58.0 | >0.58.0, <0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Selecting: numba==0.56.3 [compatible] (numba-0.56.3.tar.gz)
DEBUG Adding transitive dependency for numba==0.56.3: llvmlite>=0.39.0.dev0, <0.40
DEBUG Adding transitive dependency for numba==0.56.3: numpy>=1.18, <1.24
DEBUG Adding transitive dependency for numba==0.56.3: setuptools*
DEBUG Searching for a compatible version of numba (<0.56.3 | >0.56.3, <0.56.4 | >0.56.4, <0.57.0 | >0.57.0, <0.57.1 | >0.57.1, <0.58.0 | >0.58.0, <0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Selecting: numba==0.56.2 [compatible] (numba-0.56.2.tar.gz)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/03/92/ecf69b298baf7af49243f2e30e75c401929430511c1909928e7daa4daf4d/numba-0.56.2-cp310-cp310-macosx_10_14_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/b8/79/e867e49151ae6adbd23f5566a722feb0b7cc65b60b1556b63ad55be37857/numba-0.56.0-cp310-cp310-macosx_10_14_x86_64.whl.metadata
DEBUG Prefetching 2 numba versions
DEBUG Found fresh response for: https://pypi.org/simple/setuptools/
DEBUG Adding transitive dependency for numba==0.56.2: llvmlite>=0.39.0.dev0, <0.40
DEBUG Adding transitive dependency for numba==0.56.2: numpy>=1.18, <1.24
DEBUG Adding transitive dependency for numba==0.56.2: setuptools<60
DEBUG Searching for a compatible version of numba (<0.56.2 | >0.56.2, <0.56.3 | >0.56.3, <0.56.4 | >0.56.4, <0.57.0 | >0.57.0, <0.57.1 | >0.57.1, <0.58.0 | >0.58.0, <0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Selecting: numba==0.56.0 [compatible] (numba-0.56.0.tar.gz)
DEBUG Adding transitive dependency for numba==0.56.0: llvmlite>=0.39.0.dev0, <0.40
DEBUG Adding transitive dependency for numba==0.56.0: numpy>=1.18, <1.23
DEBUG Adding transitive dependency for numba==0.56.0: setuptools*
DEBUG Searching for a compatible version of numba (<0.56.0 | >0.56.0, <0.56.2 | >0.56.2, <0.56.3 | >0.56.3, <0.56.4 | >0.56.4, <0.57.0 | >0.57.0, <0.57.1 | >0.57.1, <0.58.0 | >0.58.0, <0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG No compatible version found for: Python
DEBUG Searching for a compatible version of numpy (*)
DEBUG Selecting: numpy==2.1.0 [compatible] (numpy-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl)
DEBUG Searching for a compatible version of numba (<0.55.2 | >0.55.2, <0.56.0 | >0.56.0, <0.56.2 | >0.56.2, <0.56.3 | >0.56.3, <0.56.4 | >0.56.4, <0.57.0 | >0.57.0, <0.57.1 | >0.57.1, <0.58.0 | >0.58.0, <0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Searching for a compatible version of numpy (*)
DEBUG Selecting: numpy==2.1.0 [compatible] (numpy-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl)
DEBUG Searching for a compatible version of numba (<0.55.1 | >0.55.1, <0.55.2 | >0.55.2, <0.56.0 | >0.56.0, <0.56.2 | >0.56.2, <0.56.3 | >0.56.3, <0.56.4 | >0.56.4, <0.57.0 | >0.57.0, <0.57.1 | >0.57.1, <0.58.0 | >0.58.0, <0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Searching for a compatible version of numpy (*)
DEBUG Selecting: numpy==2.1.0 [compatible] (numpy-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl)
DEBUG Searching for a compatible version of numba (<0.55.0 | >0.55.0, <0.55.1 | >0.55.1, <0.55.2 | >0.55.2, <0.56.0 | >0.56.0, <0.56.2 | >0.56.2, <0.56.3 | >0.56.3, <0.56.4 | >0.56.4, <0.57.0 | >0.57.0, <0.57.1 | >0.57.1, <0.58.0 | >0.58.0, <0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Searching for a compatible version of numpy (*)
DEBUG Selecting: numpy==2.1.0 [compatible] (numpy-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl)
DEBUG Prefetching 5 numpy versions
DEBUG Searching for a compatible version of numba (<0.54.1 | >0.54.1, <0.55.0 | >0.55.0, <0.55.1 | >0.55.1, <0.55.2 | >0.55.2, <0.56.0 | >0.56.0, <0.56.2 | >0.56.2, <0.56.3 | >0.56.3, <0.56.4 | >0.56.4, <0.57.0 | >0.57.0, <0.57.1 | >0.57.1, <0.58.0 | >0.58.0, <0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Searching for a compatible version of numpy (*)
DEBUG Selecting: numpy==2.1.0 [compatible] (numpy-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/ef/27/39622993e8688a1f05898a3c3b2836b856f79c06637ebd4b71cb35cc9b18/numpy-2.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/d1/27/2a7bd6855dc717aeec5f553073a3c426b9c816126555f8e616392eab856b/numpy-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
DEBUG Searching for a compatible version of numba (<0.54.0 | >0.54.0, <0.54.1 | >0.54.1, <0.55.0 | >0.55.0, <0.55.1 | >0.55.1, <0.55.2 | >0.55.2, <0.56.0 | >0.56.0, <0.56.2 | >0.56.2, <0.56.3 | >0.56.3, <0.56.4 | >0.56.4, <0.57.0 | >0.57.0, <0.57.1 | >0.57.1, <0.58.0 | >0.58.0, <0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG No compatible version found for: Python
DEBUG Searching for a compatible version of numpy (*)
DEBUG Selecting: numpy==2.1.0 [compatible] (numpy-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl)
DEBUG Searching for a compatible version of numba (<0.53.1 | >0.53.1, <0.54.0 | >0.54.0, <0.54.1 | >0.54.1, <0.55.0 | >0.55.0, <0.55.1 | >0.55.1, <0.55.2 | >0.55.2, <0.56.0 | >0.56.0, <0.56.2 | >0.56.2, <0.56.3 | >0.56.3, <0.56.4 | >0.56.4, <0.57.0 | >0.57.0, <0.57.1 | >0.57.1, <0.58.0 | >0.58.0, <0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/3a/d0/edc009c27b406c4f9cbc79274d6e46d634d139075492ad055e3d68445925/numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
DEBUG Searching for a compatible version of numpy (*)
DEBUG Selecting: numpy==2.1.0 [compatible] (numpy-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/5a/62/007b63f916aca1d27f5fede933fda3315d931ff9b2c28b9c2cf388cd8edb/numpy-1.26.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
DEBUG Searching for a compatible version of numba (<0.53.0 | >0.53.0, <0.53.1 | >0.53.1, <0.54.0 | >0.54.0, <0.54.1 | >0.54.1, <0.55.0 | >0.55.0, <0.55.1 | >0.55.1, <0.55.2 | >0.55.2, <0.56.0 | >0.56.0, <0.56.2 | >0.56.2, <0.56.3 | >0.56.3, <0.56.4 | >0.56.4, <0.57.0 | >0.57.0, <0.57.1 | >0.57.1, <0.58.0 | >0.58.0, <0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Searching for a compatible version of numpy (*)
DEBUG Selecting: numpy==2.1.0 [compatible] (numpy-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl)
DEBUG Searching for a compatible version of numba (<0.52.0 | >0.52.0, <0.53.0 | >0.53.0, <0.53.1 | >0.53.1, <0.54.0 | >0.54.0, <0.54.1 | >0.54.1, <0.55.0 | >0.55.0, <0.55.1 | >0.55.1, <0.55.2 | >0.55.2, <0.56.0 | >0.56.0, <0.56.2 | >0.56.2, <0.56.3 | >0.56.3, <0.56.4 | >0.56.4, <0.57.0 | >0.57.0, <0.57.1 | >0.57.1, <0.58.0 | >0.58.0, <0.58.1 | >0.58.1, <0.59.0 | >0.59.0, <0.59.1 | >0.59.1, <0.60.0 | >0.60.0)
DEBUG Selecting: numba==0.51.2 [compatible] (numba-0.51.2.tar.gz)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/c2/19/1722feae3fd48fa4d89f10ba364e9f6e06a405b9862a4beb4d211dc79e0d/numba-0.51.2-cp36-cp36m-macosx_10_14_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/fa/61/c3a10f4d66d12f9b8afa2513e0e3640080b4b597ff1dc601d810d611b6ee/numba-0.51.1-cp36-cp36m-macosx_10_14_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/97/c2/c0d0ae4fc3a157aad51027b0699e4ff7f29e782730dc2ec0af8fad63c9e4/numba-0.51.0-cp36-cp36m-macosx_10_14_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/bb/c5/f736704ed0129b4351a725a7f9fe926d028adfb684ecf74bf6e6262cc341/numba-0.50.1-cp36-cp36m-macosx_10_14_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/29/73/4d04b2657dbb32526c5516ef153a7ff83608f94645e1426a78b55669f404/numba-0.50.0-cp36-cp36m-macosx_10_14_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/ac/7d/e01bcbf4a35cbb07ce04aaa545030bde231331aaabe7c44726b099f8fd86/numba-0.49.1-cp36-cp36m-macosx_10_14_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/5f/8e/cb7bb3e872aa4c6a6603c15b37964521d16a46dcb2e40171d6bdaafff62a/numba-0.49.0-cp36-cp36m-macosx_10_14_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/25/59/6a67846fdec2688a4b8f1a3a55ab77e47c109615200f1b58e4cd6001f48e/numba-0.48.0-1-cp36-cp36m-manylinux1_i686.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/84/36/f3b918f9db04919bcc5c3ce5bb3613920f5341cd8309c826bec787213347/numba-0.47.0-cp27-cp27m-macosx_10_9_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/cd/0f/2f22d8ee83c7d7d3b6d773f8fe6eb09d37e25a8551ce01caeebeb38acce5/numba-0.46.0-cp27-cp27m-macosx_10_9_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/3c/8c/1a7f86bfc6f06a633f4047a1795791900ae48442194f38ee63aad2196179/numba-0.45.1-cp27-cp27m-macosx_10_9_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/cb/97/6a9a67892301a25d62563abd8b648547eb008c0429fab1e9f22d690168cd/numba-0.45.0-cp27-cp27m-macosx_10_9_x86_64.whl.metadata
DEBUG Prefetching 20 numba versions
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/d0/8f/e91c4e961defbbc7fb00c8b4549f38bcefea385fbccef67ef28574e46384/numba-0.44.1-cp27-cp27m-macosx_10_9_x86_64.whl.metadata
DEBUG Adding transitive dependency for numba==0.51.2: llvmlite>=0.34.0.dev0, <0.35
DEBUG Adding transitive dependency for numba==0.51.2: numpy>=1.15
DEBUG Adding transitive dependency for numba==0.51.2: setuptools*
DEBUG Searching for a compatible version of llvmlite (>=0.34.0.dev0, <0.35)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/d1/73/9c93d7c8ef6832ea240a24a781c98f05ed0b2550bd818e4c6a35eb3bc999/numba-0.44.0-cp27-cp27m-macosx_10_9_x86_64.whl.metadata
DEBUG Selecting: llvmlite==0.34.0 [compatible] (llvmlite-0.34.0.tar.gz)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/58/a7/6d345a3c4b11536db7c01e8af84383c96d80805ed55d2d795fa8465130d5/numba-0.43.1-1-cp27-cp27m-macosx_10_9_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/c6/90/f9dcb254c193c10b5c7e2de77a0f278d9e526f1c446f2d3aea231a3a5bec/numba-0.43.0-cp27-cp27m-macosx_10_9_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/5c/6e/6ae3753b971d55c6211646be12ea9b9bfeee4c0b62beb5f398c4a69996c0/numba-0.42.1-cp27-cp27m-macosx_10_9_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/a9/f4/c32ab347918e6064b34c66287f625fa3bb041052182079582b3c9548780d/numba-0.42.0-cp27-cp27m-macosx_10_9_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/67/70/f90b24b2de827ce15ead79d36287b63a7b10bba8c4a39f3c2bb884dc9590/numba-0.41.0-cp27-cp27m-macosx_10_9_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/62/16/c0e5f8207c6cf32d1527f202a4838a3820d4cb1c51d525709a4e7b66fe35/numba-0.40.1-cp27-cp27m-macosx_10_6_x86_64.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/6e/ec/06715d912351edc453e37f93f3fc80dcffd5ca0e70386c87529aca296f05/setuptools-72.2.0-py3-none-any.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/22/e0/6a2af71fcbc4e269964c7b1ed92a8c80e71367dc0f4e12dd35139c0c6925/llvmlite-0.34.0-cp36-cp36m-macosx_10_9_x86_64.whl.metadata
DEBUG Searching for a compatible version of setuptools (*)
DEBUG Selecting: setuptools==72.2.0 [compatible] (setuptools-72.2.0-py3-none-any.whl)
DEBUG Tried 31 versions: numba 20, numpy 9, llvmlite 1, setuptools 1
DEBUG Split specific environment resolution took 0.031s
Resolved 4 packages in 33ms
# This file was autogenerated by uv via the following command:
#    uv pip compile oof.in
llvmlite==0.34.0
    # via numba
numba==0.51.2
    # via -r oof.in
numpy==2.1.0
    # via
    #   -r oof.in
    #   numba
setuptools==72.2.0
    # via numba
@sk1p
Copy link
Author

sk1p commented Aug 19, 2024

Oh, I just noticed that I can make uv pip install fail by specifying the packages in inverted order:

$ 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 .in file to mention numba first changes the uv pip compile behavior:

$ 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

@sk1p
Copy link
Author

sk1p commented Aug 19, 2024

As a point of comparison, plain pip always installs llvmlite-0.43.0 numba-0.60.0 numpy-2.0.1, and behavior does not depend on command line ordering. I did not check pip-compile yet.

@zanieb
Copy link
Member

zanieb commented Aug 19, 2024

See also #5474 (comment)

@zanieb
Copy link
Member

zanieb commented Aug 19, 2024

I think your question regarding the effect of ordering is answered there.

I'm not sure about why uv pip compile would resolve to different versions than uv pip install — your virtual environment is definitely using the same Python version?

@sk1p
Copy link
Author

sk1p commented Aug 19, 2024

I'm not sure about why uv pip compile would resolve to different versions than uv pip install — your virtual environment is definitely using the same Python version?

Yeah, same venv, same Python version etc.

I think that was because the order in the .in file was different from the order on the command line (which was surprising for me btw.)

@zanieb
Copy link
Member

zanieb commented Aug 19, 2024

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?

@zanieb zanieb added duplicate This issue or pull request already exists question Asking for clarification or support labels Aug 19, 2024
@sk1p
Copy link
Author

sk1p commented Aug 19, 2024

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.

True.

We can document that more clearly though?

Thanks, that would be helpful. Probably at least in https://github.com/astral-sh/uv/blob/main/PIP_COMPATIBILITY.md ?

@zanieb
Copy link
Member

zanieb commented Aug 19, 2024

Yeah — I'll do that. Thanks!

@notatallshaw
Copy link
Collaborator

notatallshaw commented Aug 20, 2024

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.

@esc
Copy link

esc commented Aug 26, 2024

re, this was discussed here too: numba/numba#9708 (comment)

Also, @notatallshaw there seems to be some disagreement about pips behaviour here. Do you have any referenced to support your claim?

@notatallshaw
Copy link
Collaborator

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.

@notatallshaw
Copy link
Collaborator

notatallshaw commented Aug 27, 2024

@esc I've taken a look at the issue, and I beleive that pip is doing the right thing there because it is prioritizing depth.

uv has an open issue for adding this #3149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question Asking for clarification or support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants