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

Dependency resolution regression in 0.1.33 #3127

Closed
burgholzer opened this issue Apr 18, 2024 · 20 comments · Fixed by #3133
Closed

Dependency resolution regression in 0.1.33 #3127

burgholzer opened this issue Apr 18, 2024 · 20 comments · Fixed by #3133
Assignees
Labels
bug Something isn't working

Comments

@burgholzer
Copy link

Hey 👋🏼

thanks for all the work on uv! We recently incorporated it into all the tools we develop as part of our research (https://mqt.readthedocs.io) and the transition was really smooth! 😎

However, I believe the latest version (specifically the changes from #3087) might have broken our CI pipelines.
For a production workflow run failing, see: https://github.com/cda-tum/mqt-core/actions/runs/8744279279/job/23998070565

I tried to construct a minimal reproducible example from what I could gather. The following is the best I could come up with.

Given the following pyproject.toml

[build-system]
requires = ["scikit-build-core>=0.8.1"]
build-backend = "scikit_build_core.build"

[project]
name = "uv_reproducer"
requires-python = ">=3.8"
version = "0.1.0"

[project.optional-dependencies]
test = ["pytest>=7.0"]
coverage = ["uv_reproducer[test]", "pytest-cov>=4"]

and a minimal CMakeLists.txt

cmake_minimum_required(VERSION 3.15...3.26)
project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX)

The following chain of commands will error out

uv venv
source .venv/bin/activate
uv pip install scikit-build-core[pyproject]==0.8.1
uv pip install '-ve.[test,coverage]' --resolution=lowest-direct --no-build-isolation

See below for the complete output.
This is on uv version 0.1.33 running on Ubuntu 22.04.
Tested to work on version 0.1.32.
My guess would be that it has to do with the recursive self dependencies that are now resolved differently, for whatever reason.
Interestingly, running with build isolation, i.e.

uv venv
source .venv/bin/activate
uv pip install '-ve.[test,coverage]' --resolution=lowest-direct

works just fine.

Would be nice to know if this change was intentional and I am missing something or if there is something to be fixed here (at least the scenario above was working in previous versions). Let me know if you need any more info!

The full error log of the uv pip install '-ve.[test,coverage]' --resolution=lowest-direct --no-build-isolation command is as follows:

INFO Found a virtualenv through VIRTUAL_ENV at: /home/lburgholzer/PycharmProjects/uv-reproducer/.venv
DEBUG Cached interpreter info for Python 3.10.12, skipping probing: .venv/bin/python
DEBUG Using Python 3.10.12 environment at .venv/bin/python
DEBUG Trying to lock if free: .venv/.lock
DEBUG Using registry request timeout of 300s
DEBUG Building (editable) file:///home/lburgholzer/PycharmProjects/uv-reproducer
DEBUG Calling `scikit_build_core.build.build_editable(metadata_directory=None)`
DEBUG Finished building (editable): uv-reproducer @ file:///home/lburgholzer/PycharmProjects/uv-reproducer
Built 1 editable in 635ms
DEBUG Solving with target Python version 3.10.12
DEBUG Searching for a compatible version of uv-reproducer[coverage] @ file:///home/lburgholzer/PycharmProjects/uv-reproducer (==0.1.0)
DEBUG Adding transitive dependency for uv-reproducer[coverage]0.1.0: uv-reproducer*
DEBUG Adding transitive dependency for uv-reproducer[coverage]0.1.0: uv-reproducer[test]*
DEBUG Adding transitive dependency for uv-reproducer[coverage]0.1.0: pytest-cov>=4
TRACE Fetching metadata for pytest-cov from https://pypi.org/simple/pytest-cov/
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/simple-v7/pypi/pytest-cov.rkyv
DEBUG No cache entry for: https://pypi.org/simple/pytest-cov/
TRACE Sending fresh GET request for https://pypi.org/simple/pytest-cov/
TRACE Handling request for https://pypi.org/simple/pytest-cov/
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://pypi.org/simple/pytest-cov/
DEBUG Preparing metadata for: uv-reproducer @ file:///home/lburgholzer/PycharmProjects/uv-reproducer
DEBUG No static `PKG-INFO` available for: uv-reproducer @ file:///home/lburgholzer/PycharmProjects/uv-reproducer (MissingPkgInfo)
DEBUG Found static `pyproject.toml` for: uv-reproducer @ file:///home/lburgholzer/PycharmProjects/uv-reproducer
TRACE Received source distribution metadata for: uv-reproducer @ file:///home/lburgholzer/PycharmProjects/uv-reproducer
TRACE cached request https://pypi.org/simple/pytest-cov/ is storable because its response has a 'public' cache-control directive
TRACE Received package metadata for: pytest-cov
TRACE selecting candidate for package pytest-cov with range Range { segments: [(Included("4"), Unbounded)] } with 46 remote versions
TRACE found candidate for package PackageName("pytest-cov") with range Range { segments: [(Included("4"), Unbounded)] } after 43 steps: "4.0.0" version
DEBUG Searching for a compatible version of pytest-cov (>=4)
TRACE selecting candidate for package pytest-cov with range Range { segments: [(Included("4"), Unbounded)] } with 46 remote versions
TRACE found candidate for package PackageName("pytest-cov") with range Range { segments: [(Included("4"), Unbounded)] } after 43 steps: "4.0.0" version
DEBUG Selecting: pytest-cov==4.0.0 (pytest_cov-4.0.0-py3-none-any.whl)
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/wheels-v1/pypi/pytest-cov/pytest_cov-4.0.0-py3-none-any.msgpack
DEBUG No cache entry for: https://files.pythonhosted.org/packages/fe/1f/9ec0ddd33bd2b37d6ec50bb39155bca4fe7085fa78b3b434c05459a860e3/pytest_cov-4.0.0-py3-none-any.whl.metadata
TRACE Sending fresh GET request for https://files.pythonhosted.org/packages/fe/1f/9ec0ddd33bd2b37d6ec50bb39155bca4fe7085fa78b3b434c05459a860e3/pytest_cov-4.0.0-py3-none-any.whl.metadata
TRACE Handling request for https://files.pythonhosted.org/packages/fe/1f/9ec0ddd33bd2b37d6ec50bb39155bca4fe7085fa78b3b434c05459a860e3/pytest_cov-4.0.0-py3-none-any.whl.metadata
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://files.pythonhosted.org/packages/fe/1f/9ec0ddd33bd2b37d6ec50bb39155bca4fe7085fa78b3b434c05459a860e3/pytest_cov-4.0.0-py3-none-any.whl.metadata
TRACE cached request https://files.pythonhosted.org/packages/fe/1f/9ec0ddd33bd2b37d6ec50bb39155bca4fe7085fa78b3b434c05459a860e3/pytest_cov-4.0.0-py3-none-any.whl.metadata is storable because its response has a 'public' cache-control directive
TRACE Received built distribution metadata for: pytest-cov==4.0.0
DEBUG Adding transitive dependency: pytest>=4.6
DEBUG Adding transitive dependency: coverage>=5.2.1
DEBUG Adding transitive dependency: coverage[toml]>=5.2.1
TRACE Fetching metadata for pytest from https://pypi.org/simple/pytest/
TRACE Fetching metadata for coverage from https://pypi.org/simple/coverage/
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/simple-v7/pypi/pytest.rkyv
DEBUG No cache entry for: https://pypi.org/simple/pytest/
TRACE Sending fresh GET request for https://pypi.org/simple/pytest/
TRACE Handling request for https://pypi.org/simple/pytest/
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://pypi.org/simple/pytest/
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/simple-v7/pypi/coverage.rkyv
DEBUG No cache entry for: https://pypi.org/simple/coverage/
TRACE Sending fresh GET request for https://pypi.org/simple/coverage/
TRACE Handling request for https://pypi.org/simple/coverage/
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://pypi.org/simple/coverage/
TRACE cached request https://pypi.org/simple/pytest/ is storable because its response has a 'public' cache-control directive
TRACE Received package metadata for: pytest
TRACE selecting candidate for package pytest with range Range { segments: [(Included("4.6"), Unbounded)] } with 173 remote versions
TRACE found candidate for package PackageName("pytest") with range Range { segments: [(Included("4.6"), Unbounded)] } after 102 steps: "4.6.0" version
DEBUG Searching for a compatible version of pytest (>=4.6)
TRACE selecting candidate for package pytest with range Range { segments: [(Included("4.6"), Unbounded)] } with 173 remote versions
TRACE found candidate for package PackageName("pytest") with range Range { segments: [(Included("4.6"), Unbounded)] } after 102 steps: "4.6.0" version
DEBUG Selecting: pytest==4.6.0 (pytest-4.6.0-py2.py3-none-any.whl)
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/wheels-v1/pypi/pytest/pytest-4.6.0-py2.py3-none-any.msgpack
DEBUG No cache entry for: https://files.pythonhosted.org/packages/98/b8/db268d7c6b517af5b1731fc95d13e89a5032116a1482f2badb423333a420/pytest-4.6.0-py2.py3-none-any.whl.metadata
TRACE Sending fresh GET request for https://files.pythonhosted.org/packages/98/b8/db268d7c6b517af5b1731fc95d13e89a5032116a1482f2badb423333a420/pytest-4.6.0-py2.py3-none-any.whl.metadata
TRACE Handling request for https://files.pythonhosted.org/packages/98/b8/db268d7c6b517af5b1731fc95d13e89a5032116a1482f2badb423333a420/pytest-4.6.0-py2.py3-none-any.whl.metadata
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://files.pythonhosted.org/packages/98/b8/db268d7c6b517af5b1731fc95d13e89a5032116a1482f2badb423333a420/pytest-4.6.0-py2.py3-none-any.whl.metadata
TRACE cached request https://pypi.org/simple/coverage/ is storable because its response has a 'public' cache-control directive
TRACE cached request https://files.pythonhosted.org/packages/98/b8/db268d7c6b517af5b1731fc95d13e89a5032116a1482f2badb423333a420/pytest-4.6.0-py2.py3-none-any.whl.metadata is storable because its response has a 'public' cache-control directive
TRACE Received built distribution metadata for: pytest==4.6.0
DEBUG Adding transitive dependency: py>=1.5.0
DEBUG Adding transitive dependency: six>=1.10.0
DEBUG Adding transitive dependency: packaging*
DEBUG Adding transitive dependency: attrs>=17.4.0
DEBUG Adding transitive dependency: atomicwrites>=1.0
DEBUG Adding transitive dependency: pluggy>=0.12, <1.0
DEBUG Adding transitive dependency: importlib-metadata>=0.12
DEBUG Adding transitive dependency: wcwidth*
DEBUG Adding transitive dependency: more-itertools>=4.0.0
TRACE Fetching metadata for py from https://pypi.org/simple/py/
TRACE Fetching metadata for six from https://pypi.org/simple/six/
TRACE Fetching metadata for packaging from https://pypi.org/simple/packaging/
TRACE Fetching metadata for attrs from https://pypi.org/simple/attrs/
TRACE Fetching metadata for atomicwrites from https://pypi.org/simple/atomicwrites/
TRACE Fetching metadata for pluggy from https://pypi.org/simple/pluggy/
TRACE Fetching metadata for importlib-metadata from https://pypi.org/simple/importlib-metadata/
TRACE Fetching metadata for wcwidth from https://pypi.org/simple/wcwidth/
TRACE Fetching metadata for more-itertools from https://pypi.org/simple/more-itertools/
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/simple-v7/pypi/py.rkyv
DEBUG No cache entry for: https://pypi.org/simple/py/
TRACE Sending fresh GET request for https://pypi.org/simple/py/
TRACE Handling request for https://pypi.org/simple/py/
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://pypi.org/simple/py/
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/simple-v7/pypi/six.rkyv
DEBUG No cache entry for: https://pypi.org/simple/six/
TRACE Sending fresh GET request for https://pypi.org/simple/six/
TRACE Handling request for https://pypi.org/simple/six/
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://pypi.org/simple/six/
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/simple-v7/pypi/attrs.rkyv
DEBUG No cache entry for: https://pypi.org/simple/attrs/
TRACE Sending fresh GET request for https://pypi.org/simple/attrs/
TRACE Handling request for https://pypi.org/simple/attrs/
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://pypi.org/simple/attrs/
TRACE cached request https://pypi.org/simple/packaging/ is storable because its response has a 'public' cache-control directive
DEBUG Found fresh response for: https://pypi.org/simple/packaging/
TRACE Received package metadata for: packaging
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/simple-v7/pypi/pluggy.rkyv
DEBUG No cache entry for: https://pypi.org/simple/pluggy/
TRACE Sending fresh GET request for https://pypi.org/simple/pluggy/
TRACE Handling request for https://pypi.org/simple/pluggy/
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://pypi.org/simple/pluggy/
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/simple-v7/pypi/atomicwrites.rkyv
DEBUG No cache entry for: https://pypi.org/simple/atomicwrites/
TRACE Sending fresh GET request for https://pypi.org/simple/atomicwrites/
TRACE Handling request for https://pypi.org/simple/atomicwrites/
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://pypi.org/simple/atomicwrites/
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/simple-v7/pypi/importlib-metadata.rkyv
DEBUG No cache entry for: https://pypi.org/simple/importlib-metadata/
TRACE Sending fresh GET request for https://pypi.org/simple/importlib-metadata/
TRACE Handling request for https://pypi.org/simple/importlib-metadata/
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://pypi.org/simple/importlib-metadata/
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/simple-v7/pypi/wcwidth.rkyv
DEBUG No cache entry for: https://pypi.org/simple/wcwidth/
TRACE Sending fresh GET request for https://pypi.org/simple/wcwidth/
TRACE Handling request for https://pypi.org/simple/wcwidth/
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://pypi.org/simple/wcwidth/
DEBUG Found installed version of packaging==24.0 that satisfies preference in *
TRACE Received installed distribution metadata for: packaging==24.0
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/simple-v7/pypi/more-itertools.rkyv
DEBUG No cache entry for: https://pypi.org/simple/more-itertools/
TRACE Sending fresh GET request for https://pypi.org/simple/more-itertools/
TRACE Handling request for https://pypi.org/simple/more-itertools/
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://pypi.org/simple/more-itertools/
TRACE cached request https://pypi.org/simple/py/ is storable because its response has a 'public' cache-control directive
TRACE Received package metadata for: py
TRACE selecting candidate for package py with range Range { segments: [(Included("1.5.0"), Unbounded)] } with 62 remote versions
TRACE found candidate for package PackageName("py") with range Range { segments: [(Included("1.5.0"), Unbounded)] } after 0 steps: "1.11.0" version
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/wheels-v1/pypi/py/py-1.11.0-py2.py3-none-any.msgpack
DEBUG No cache entry for: https://files.pythonhosted.org/packages/f6/f0/10642828a8dfb741e5f3fbaac830550a518a775c7fff6f04a007259b0548/py-1.11.0-py2.py3-none-any.whl.metadata
TRACE Sending fresh GET request for https://files.pythonhosted.org/packages/f6/f0/10642828a8dfb741e5f3fbaac830550a518a775c7fff6f04a007259b0548/py-1.11.0-py2.py3-none-any.whl.metadata
TRACE Handling request for https://files.pythonhosted.org/packages/f6/f0/10642828a8dfb741e5f3fbaac830550a518a775c7fff6f04a007259b0548/py-1.11.0-py2.py3-none-any.whl.metadata
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://files.pythonhosted.org/packages/f6/f0/10642828a8dfb741e5f3fbaac830550a518a775c7fff6f04a007259b0548/py-1.11.0-py2.py3-none-any.whl.metadata
TRACE cached request https://pypi.org/simple/six/ is storable because its response has a 'public' cache-control directive
TRACE cached request https://files.pythonhosted.org/packages/f6/f0/10642828a8dfb741e5f3fbaac830550a518a775c7fff6f04a007259b0548/py-1.11.0-py2.py3-none-any.whl.metadata is storable because its response has a 'public' cache-control directive
TRACE Received built distribution metadata for: py==1.11.0
TRACE Received package metadata for: six
TRACE selecting candidate for package six with range Range { segments: [(Included("1.10.0"), Unbounded)] } with 28 remote versions
TRACE found candidate for package PackageName("six") with range Range { segments: [(Included("1.10.0"), Unbounded)] } after 0 steps: "1.16.0" version
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/wheels-v1/pypi/six/six-1.16.0-py2.py3-none-any.msgpack
DEBUG No cache entry for: https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl.metadata
TRACE Sending fresh GET request for https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl.metadata
TRACE Handling request for https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl.metadata
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl.metadata
TRACE Received package metadata for: coverage
TRACE selecting candidate for package coverage with range Range { segments: [(Included("5.2.1"), Unbounded)] } with 129 remote versions
TRACE found candidate for package PackageName("coverage") with range Range { segments: [(Included("5.2.1"), Unbounded)] } after 0 steps: "7.4.4" version
TRACE selecting candidate for package coverage with range Range { segments: [(Included("5.2.1"), Unbounded)] } with 129 remote versions
TRACE found candidate for package PackageName("coverage") with range Range { segments: [(Included("5.2.1"), Unbounded)] } after 0 steps: "7.4.4" version
DEBUG Searching for a compatible version of coverage (>=5.2.1)
TRACE selecting candidate for package coverage with range Range { segments: [(Included("5.2.1"), Unbounded)] } with 129 remote versions
TRACE found candidate for package PackageName("coverage") with range Range { segments: [(Included("5.2.1"), Unbounded)] } after 0 steps: "7.4.4" version
DEBUG Selecting: coverage==7.4.4 (coverage-7.4.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl)
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/wheels-v1/pypi/coverage/coverage-7.4.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.msgpack
DEBUG No cache entry for: https://files.pythonhosted.org/packages/93/41/e6e9dbb322f3c93aba7bc519b9c62846d923d7b57398bdd7eda3f0acdd11/coverage-7.4.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
TRACE Sending fresh GET request for https://files.pythonhosted.org/packages/93/41/e6e9dbb322f3c93aba7bc519b9c62846d923d7b57398bdd7eda3f0acdd11/coverage-7.4.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
TRACE Handling request for https://files.pythonhosted.org/packages/93/41/e6e9dbb322f3c93aba7bc519b9c62846d923d7b57398bdd7eda3f0acdd11/coverage-7.4.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://files.pythonhosted.org/packages/93/41/e6e9dbb322f3c93aba7bc519b9c62846d923d7b57398bdd7eda3f0acdd11/coverage-7.4.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
TRACE cached request https://pypi.org/simple/attrs/ is storable because its response has a 'public' cache-control directive
TRACE cached request https://pypi.org/simple/pluggy/ is storable because its response has a 'public' cache-control directive
TRACE Received package metadata for: attrs
TRACE cached request https://pypi.org/simple/atomicwrites/ is storable because its response has a 'public' cache-control directive
TRACE selecting candidate for package attrs with range Range { segments: [(Included("17.4.0"), Unbounded)] } with 28 remote versions
TRACE found candidate for package PackageName("attrs") with range Range { segments: [(Included("17.4.0"), Unbounded)] } after 0 steps: "23.2.0" version
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/wheels-v1/pypi/attrs/attrs-23.2.0-py3-none-any.msgpack
DEBUG No cache entry for: https://files.pythonhosted.org/packages/e0/44/827b2a91a5816512fcaf3cc4ebc465ccd5d598c45cefa6703fcf4a79018f/attrs-23.2.0-py3-none-any.whl.metadata
TRACE Sending fresh GET request for https://files.pythonhosted.org/packages/e0/44/827b2a91a5816512fcaf3cc4ebc465ccd5d598c45cefa6703fcf4a79018f/attrs-23.2.0-py3-none-any.whl.metadata
TRACE Handling request for https://files.pythonhosted.org/packages/e0/44/827b2a91a5816512fcaf3cc4ebc465ccd5d598c45cefa6703fcf4a79018f/attrs-23.2.0-py3-none-any.whl.metadata
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://files.pythonhosted.org/packages/e0/44/827b2a91a5816512fcaf3cc4ebc465ccd5d598c45cefa6703fcf4a79018f/attrs-23.2.0-py3-none-any.whl.metadata
TRACE Received package metadata for: pluggy
TRACE selecting candidate for package pluggy with range Range { segments: [(Included("0.12"), Excluded("1.0"))] } with 22 remote versions
TRACE found candidate for package PackageName("pluggy") with range Range { segments: [(Included("0.12"), Excluded("1.0"))] } after 6 steps: "0.13.1" version
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/wheels-v1/pypi/pluggy/pluggy-0.13.1-py2.py3-none-any.msgpack
DEBUG No cache entry for: https://files.pythonhosted.org/packages/a0/28/85c7aa31b80d150b772fbe4a229487bc6644da9ccb7e427dd8cc60cb8a62/pluggy-0.13.1-py2.py3-none-any.whl.metadata
TRACE Sending fresh GET request for https://files.pythonhosted.org/packages/a0/28/85c7aa31b80d150b772fbe4a229487bc6644da9ccb7e427dd8cc60cb8a62/pluggy-0.13.1-py2.py3-none-any.whl.metadata
TRACE Handling request for https://files.pythonhosted.org/packages/a0/28/85c7aa31b80d150b772fbe4a229487bc6644da9ccb7e427dd8cc60cb8a62/pluggy-0.13.1-py2.py3-none-any.whl.metadata
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://files.pythonhosted.org/packages/a0/28/85c7aa31b80d150b772fbe4a229487bc6644da9ccb7e427dd8cc60cb8a62/pluggy-0.13.1-py2.py3-none-any.whl.metadata
TRACE Received package metadata for: atomicwrites
TRACE selecting candidate for package atomicwrites with range Range { segments: [(Included("1.0"), Unbounded)] } with 18 remote versions
TRACE found candidate for package PackageName("atomicwrites") with range Range { segments: [(Included("1.0"), Unbounded)] } after 0 steps: "1.4.1" version
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/built-wheels-v3/pypi/atomicwrites/1.4.1/revision.http
DEBUG No cache entry for: https://files.pythonhosted.org/packages/87/c6/53da25344e3e3a9c01095a89f16dbcda021c609ddb42dd6d7c0528236fb2/atomicwrites-1.4.1.tar.gz
TRACE Sending fresh GET request for https://files.pythonhosted.org/packages/87/c6/53da25344e3e3a9c01095a89f16dbcda021c609ddb42dd6d7c0528236fb2/atomicwrites-1.4.1.tar.gz
TRACE Handling request for https://files.pythonhosted.org/packages/87/c6/53da25344e3e3a9c01095a89f16dbcda021c609ddb42dd6d7c0528236fb2/atomicwrites-1.4.1.tar.gz
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://files.pythonhosted.org/packages/87/c6/53da25344e3e3a9c01095a89f16dbcda021c609ddb42dd6d7c0528236fb2/atomicwrites-1.4.1.tar.gz
TRACE cached request https://pypi.org/simple/more-itertools/ is storable because its response has a 'public' cache-control directive
TRACE cached request https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl.metadata is storable because its response has a 'public' cache-control directive
TRACE Received built distribution metadata for: six==1.16.0
TRACE cached request https://pypi.org/simple/importlib-metadata/ is storable because its response has a 'public' cache-control directive
TRACE cached request https://pypi.org/simple/wcwidth/ is storable because its response has a 'public' cache-control directive
TRACE Received package metadata for: wcwidth
TRACE selecting candidate for package wcwidth with range Range { segments: [(Unbounded, Unbounded)] } with 25 remote versions
TRACE found candidate for package PackageName("wcwidth") with range Range { segments: [(Unbounded, Unbounded)] } after 0 steps: "0.2.13" version
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/wheels-v1/pypi/wcwidth/wcwidth-0.2.13-py2.py3-none-any.msgpack
DEBUG No cache entry for: https://files.pythonhosted.org/packages/fd/84/fd2ba7aafacbad3c4201d395674fc6348826569da3c0937e75505ead3528/wcwidth-0.2.13-py2.py3-none-any.whl.metadata
TRACE Sending fresh GET request for https://files.pythonhosted.org/packages/fd/84/fd2ba7aafacbad3c4201d395674fc6348826569da3c0937e75505ead3528/wcwidth-0.2.13-py2.py3-none-any.whl.metadata
TRACE Handling request for https://files.pythonhosted.org/packages/fd/84/fd2ba7aafacbad3c4201d395674fc6348826569da3c0937e75505ead3528/wcwidth-0.2.13-py2.py3-none-any.whl.metadata
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://files.pythonhosted.org/packages/fd/84/fd2ba7aafacbad3c4201d395674fc6348826569da3c0937e75505ead3528/wcwidth-0.2.13-py2.py3-none-any.whl.metadata
TRACE Received package metadata for: more-itertools
TRACE selecting candidate for package more-itertools with range Range { segments: [(Included("4.0.0"), Unbounded)] } with 45 remote versions
TRACE found candidate for package PackageName("more-itertools") with range Range { segments: [(Included("4.0.0"), Unbounded)] } after 0 steps: "10.2.0" version
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/wheels-v1/pypi/more-itertools/more_itertools-10.2.0-py3-none-any.msgpack
DEBUG No cache entry for: https://files.pythonhosted.org/packages/50/e2/8e10e465ee3987bb7c9ab69efb91d867d93959095f4807db102d07995d94/more_itertools-10.2.0-py3-none-any.whl.metadata
TRACE Sending fresh GET request for https://files.pythonhosted.org/packages/50/e2/8e10e465ee3987bb7c9ab69efb91d867d93959095f4807db102d07995d94/more_itertools-10.2.0-py3-none-any.whl.metadata
TRACE Handling request for https://files.pythonhosted.org/packages/50/e2/8e10e465ee3987bb7c9ab69efb91d867d93959095f4807db102d07995d94/more_itertools-10.2.0-py3-none-any.whl.metadata
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://files.pythonhosted.org/packages/50/e2/8e10e465ee3987bb7c9ab69efb91d867d93959095f4807db102d07995d94/more_itertools-10.2.0-py3-none-any.whl.metadata
TRACE Received package metadata for: importlib-metadata
TRACE selecting candidate for package importlib-metadata with range Range { segments: [(Included("0.12"), Unbounded)] } with 114 remote versions
TRACE found candidate for package PackageName("importlib-metadata") with range Range { segments: [(Included("0.12"), Unbounded)] } after 0 steps: "7.1.0" version
TRACE No cache entry exists for /home/lburgholzer/.cache/uv/wheels-v1/pypi/importlib-metadata/importlib_metadata-7.1.0-py3-none-any.msgpack
DEBUG No cache entry for: https://files.pythonhosted.org/packages/2d/0a/679461c511447ffaf176567d5c496d1de27cbe34a87df6677d7171b2fbd4/importlib_metadata-7.1.0-py3-none-any.whl.metadata
TRACE Sending fresh GET request for https://files.pythonhosted.org/packages/2d/0a/679461c511447ffaf176567d5c496d1de27cbe34a87df6677d7171b2fbd4/importlib_metadata-7.1.0-py3-none-any.whl.metadata
TRACE Handling request for https://files.pythonhosted.org/packages/2d/0a/679461c511447ffaf176567d5c496d1de27cbe34a87df6677d7171b2fbd4/importlib_metadata-7.1.0-py3-none-any.whl.metadata
TRACE No credentials on request, checking cache...
TRACE No credentials in cache.
DEBUG No credentials found for https://files.pythonhosted.org/packages/2d/0a/679461c511447ffaf176567d5c496d1de27cbe34a87df6677d7171b2fbd4/importlib_metadata-7.1.0-py3-none-any.whl.metadata
TRACE cached request https://files.pythonhosted.org/packages/93/41/e6e9dbb322f3c93aba7bc519b9c62846d923d7b57398bdd7eda3f0acdd11/coverage-7.4.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata is storable because its response has a 'public' cache-control directive
TRACE Received built distribution metadata for: coverage==7.4.4
DEBUG Searching for a compatible version of coverage[toml] (>=5.2.1)
TRACE selecting candidate for package coverage with range Range { segments: [(Included("5.2.1"), Unbounded)] } with 129 remote versions
TRACE found candidate for package PackageName("coverage") with range Range { segments: [(Included("5.2.1"), Unbounded)] } after 0 steps: "7.4.4" version
DEBUG Selecting: coverage[toml]==7.4.4 (coverage-7.4.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl)
DEBUG Adding transitive dependency: tomli*
DEBUG Searching for a compatible version of py (>=1.5.0)
TRACE selecting candidate for package py with range Range { segments: [(Included("1.5.0"), Unbounded)] } with 62 remote versions
TRACE found candidate for package PackageName("py") with range Range { segments: [(Included("1.5.0"), Unbounded)] } after 0 steps: "1.11.0" version
DEBUG Selecting: py==1.11.0 (py-1.11.0-py2.py3-none-any.whl)
DEBUG Searching for a compatible version of six (>=1.10.0)
TRACE selecting candidate for package six with range Range { segments: [(Included("1.10.0"), Unbounded)] } with 28 remote versions
TRACE found candidate for package PackageName("six") with range Range { segments: [(Included("1.10.0"), Unbounded)] } after 0 steps: "1.16.0" version
DEBUG Selecting: six==1.16.0 (six-1.16.0-py2.py3-none-any.whl)
DEBUG Searching for a compatible version of attrs (>=17.4.0)
TRACE selecting candidate for package attrs with range Range { segments: [(Included("17.4.0"), Unbounded)] } with 28 remote versions
TRACE found candidate for package PackageName("attrs") with range Range { segments: [(Included("17.4.0"), Unbounded)] } after 0 steps: "23.2.0" version
DEBUG Selecting: attrs==23.2.0 (attrs-23.2.0-py3-none-any.whl)
TRACE Fetching metadata for tomli from https://pypi.org/simple/tomli/
TRACE cached request https://pypi.org/simple/tomli/ is storable because its response has a 'public' cache-control directive
DEBUG Found fresh response for: https://pypi.org/simple/tomli/
TRACE Received package metadata for: tomli
DEBUG Found installed version of tomli==2.0.1 that satisfies preference in *
TRACE Received installed distribution metadata for: tomli==2.0.1
TRACE cached request https://files.pythonhosted.org/packages/e0/44/827b2a91a5816512fcaf3cc4ebc465ccd5d598c45cefa6703fcf4a79018f/attrs-23.2.0-py3-none-any.whl.metadata is storable because its response has a 'public' cache-control directive
TRACE Received built distribution metadata for: attrs==23.2.0
DEBUG Searching for a compatible version of atomicwrites (>=1.0)
TRACE selecting candidate for package atomicwrites with range Range { segments: [(Included("1.0"), Unbounded)] } with 18 remote versions
TRACE found candidate for package PackageName("atomicwrites") with range Range { segments: [(Included("1.0"), Unbounded)] } after 0 steps: "1.4.1" version
DEBUG Selecting: atomicwrites==1.4.1 (atomicwrites-1.4.1.tar.gz)
TRACE cached request https://files.pythonhosted.org/packages/87/c6/53da25344e3e3a9c01095a89f16dbcda021c609ddb42dd6d7c0528236fb2/atomicwrites-1.4.1.tar.gz is storable because its response has a 'public' cache-control directive
DEBUG Downloading source distribution: atomicwrites==1.4.1
DEBUG Preparing metadata for: atomicwrites==1.4.1
DEBUG No static `PKG-INFO` available for: atomicwrites==1.4.1 (DynamicPkgInfo(UnsupportedMetadataVersion("1.2")))
DEBUG No static `pyproject.toml` available for: atomicwrites==1.4.1 (MissingPyprojectToml)
DEBUG Calling `setuptools.build_meta:__legacy__.prepare_metadata_for_build_wheel()`
TRACE cached request https://files.pythonhosted.org/packages/fd/84/fd2ba7aafacbad3c4201d395674fc6348826569da3c0937e75505ead3528/wcwidth-0.2.13-py2.py3-none-any.whl.metadata is storable because its response has a 'public' cache-control directive
TRACE Received built distribution metadata for: wcwidth==0.2.13
TRACE cached request https://files.pythonhosted.org/packages/a0/28/85c7aa31b80d150b772fbe4a229487bc6644da9ccb7e427dd8cc60cb8a62/pluggy-0.13.1-py2.py3-none-any.whl.metadata is storable because its response has a 'public' cache-control directive
TRACE Received built distribution metadata for: pluggy==0.13.1
TRACE cached request https://files.pythonhosted.org/packages/50/e2/8e10e465ee3987bb7c9ab69efb91d867d93959095f4807db102d07995d94/more_itertools-10.2.0-py3-none-any.whl.metadata is storable because its response has a 'public' cache-control directive
TRACE Received built distribution metadata for: more-itertools==10.2.0
TRACE cached request https://files.pythonhosted.org/packages/2d/0a/679461c511447ffaf176567d5c496d1de27cbe34a87df6677d7171b2fbd4/importlib_metadata-7.1.0-py3-none-any.whl.metadata is storable because its response has a 'public' cache-control directive
TRACE Received built distribution metadata for: importlib-metadata==7.1.0
error: Failed to download and build: atomicwrites==1.4.1
  Caused by: Failed to build: atomicwrites==1.4.1
  Caused by: Build backend failed to determine metadata through `prepare_metadata_for_build_wheel` with exit status: 1
--- stdout:

--- stderr:
Traceback (most recent call last):
  File "<string>", line 8, in <module>
ModuleNotFoundError: No module named 'setuptools'
---
@charliermarsh
Copy link
Member

Thanks, I’ll have to look at the changelog to see what’s up. My initial reaction is that there’s probably a real problem with that package? But that (by chance?) we went down a different resolution path in the prior version — probably due to incorporating pip’s heuristics around how we prioritize packages.

@charliermarsh
Copy link
Member

(But need to revisit when I’m back at my laptop.)

@charliermarsh
Copy link
Member

Can I ask why you're running with --no-build-isolation? And, if intentional, why not install setuptools, since it seems to be needed to build some of the requisite packages?

@charliermarsh charliermarsh self-assigned this Apr 18, 2024
@charliermarsh charliermarsh added the question Asking for clarification or support label Apr 18, 2024
@burgholzer
Copy link
Author

Can I ask why you're running with --no-build-isolation? And, if intentional, why not install setuptools, since it seems to be needed to build some of the requisite packages?

Running with no build isolation can speed up repeated builds and is especially helpful when working with compiled extensions because it does not create a throwaway temporary directory for the build but maintains a set build directory, allowing for much faster rebuilds.

I don't believe installing setuptools is the right solution here as it is not a direct dependency of our project (neither is it in the reproducer).
Note also, that unwinding the recursive self dependencies and replacing the "uv_reproducer[test]" in the coverage extra definition by "pytest>=7" works without any problems.
I would consider this (pytest + pytest-cov) one of the most common setups for measuring code coverage in Python. That combination is pretty much tried and tested.
I am fairly confident that the problem here has something to do with how "--resolution=lowest-direct" interacts with recursive self-dependencies.

@charliermarsh
Copy link
Member

I'll take a closer look, but:

I don't believe installing setuptools is the right solution here as it is not a direct dependency of our project (neither is it in the reproducer).

I don't think this is the right criteria though, is it? If you run with --no-build-isolation, you must install all build dependencies of all of your dependencies upfront. Like, would you agree that if your resolution leads to installing atomicwrites==1.4.1, and you're running with --no-build-isolation, you must install setuptools in order to succeed?

@charliermarsh
Copy link
Member

I think the pytest>=7.0 is being enforced "too late" due to the order in which we're visiting the requirements. So we try to solve pytest-cov>=4 before we expand uv_reproducer[test]. Presumedly it would end up reaching the same conclusion by backtracking, but it's building older versions than is strictly necessary.

@charliermarsh charliermarsh added bug Something isn't working and removed question Asking for clarification or support labels Apr 18, 2024
@hmc-cs-mdrissi
Copy link

Disable isolation when building a modern source distribution. Build dependencies specified by PEP 518 must be already installed if this option is used.

https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-no-build-isolation

--no-build-isolation means you must install all build dependencies manually. setuptools might be special cased by pip due to legacy reasons, but even that is not required and newer pip is allowed to break here too. Although exact resolver/backtracking behavior is going to be very installer specific. You must manually manage your build dependencies for all packages you resolve if you use it.

In practice this tends to be not bad as build dependencies are relatively uncommon that I normally do,

pip install a b c --no-dependencies # build dependencies
pip install requirements.txt --no-dependencies --no-build-isolation

@burgholzer
Copy link
Author

I'll take a closer look, but:

I don't believe installing setuptools is the right solution here as it is not a direct dependency of our project (neither is it in the reproducer).

I don't think this is the right criteria though, is it? If you run with --no-build-isolation, you must install all build dependencies of all of your dependencies upfront. Like, would you agree that if your resolution leads to installing atomicwrites==1.4.1, and you're running with --no-build-isolation, you must install setuptools in order to succeed?

No, the build isolation setting is not transitive. It only holds for the current package. At least that's what I've gotten to learn from pip.

https://pip.pypa.io/en/stable/cli/pip_install/#options just states:

--no-build-isolation
Disable isolation when building a modern source distribution. Build dependencies specified by PEP 518 must be already installed if this option is used.

In the reproducer above, the only build dependency (scikit-build-core) is installed prior to the main package install.

@charliermarsh
Copy link
Member

I think we should avoid trying to build this package at all (i.e., I agree that this shouldn't require setuptools), but you definitely need to install all build dependencies for all transitive dependencies that will be built from source, if you run with --no-build-isolation. (For example: try running pip install pytest==4.6.0 --no-build-isolation in an environment without setuptools.)

@notatallshaw
Copy link
Contributor

notatallshaw commented Apr 18, 2024

The issue appears to be uv 0.1.33 is selecting an old version of pytest:

DEBUG Selecting: pytest==4.6.0 (pytest-4.6.0-py2.py3-none-any.whl)

Even though the requirements included a higher lower bound:

test = ["pytest>=7.0"]

In uv 0.1.32 a much higher version of pytest is selected (that matches the constraints of the lower bound):

DEBUG Selecting: pytest==7.0.0 (pytest-7.0.0-py3-none-any.whl)

The requirement for atomicwrites was removed for non-Windows platforms in pytest 5.3.0.

@notatallshaw
Copy link
Contributor

I think the pytest>=7.0 is being enforced "too late" due to the order in which we're visiting the requirements. So we try to solve pytest-cov>=4 before we expand uv_reproducer[test]. Presumedly it would end up reaching the same conclusion by backtracking, but it's building older versions than is strictly necessary.

Oh, @charliermarsh already beat me to while I was testing and writing the post.

@charliermarsh
Copy link
Member

Haha yeah. That matches my diagnosis above. Because of the heuristics (which are clearly off a bit), we're fully resolving pytest-cov>=4 before we even look at uv_reproducer[test], which adds the extra constraint.

@burgholzer
Copy link
Author

I think the pytest>=7.0 is being enforced "too late" due to the order in which we're visiting the requirements. So we try to solve pytest-cov>=4 before we expand uv_reproducer[test]. Presumedly it would end up reaching the same conclusion by backtracking, but it's building older versions than is strictly necessary.

I would also suspect this to be the case.
I guess most of the errors that pop up with "--resolution=lowest-direct" originate from rather old packages that are being resolved. And if the "pytest-cov" resolution were the only one to take place here, I would totally consider that a package/user error and definitely not an error with uv, given that it resolved correctly.
In this case, however, it could (maybe should) be able to detect that a different dependency applies a stricter lower bound and hence, it may only try from that version onwards anyways.

@charliermarsh
Copy link
Member

Yeah, there's something for us to fix here. I'll look into it.

@burgholzer
Copy link
Author

I think we should avoid trying to build this package at all (i.e., I agree that this shouldn't require setuptools), but you definitely need to install all build dependencies for all transitive dependencies that will be built from source, if you run with --no-build-isolation. (For example: try running pip install pytest==4.6.0 --no-build-isolation in an environment without setuptools.)

Thanks for pointing that out! Didn't know that before 🙌

@hmc-cs-mdrissi
Copy link

No, the build isolation setting is not transitive. It only holds for the current package. At least that's what I've gotten to learn from pip.

I don't follow this. My experience using pip is it is transitive and I've just confirmed this. The easiest way is to test this manually by installing library A that has dependency B which depends on some build dependency and avoid installing it yourself. pip will crash here even though A does not have any build dependencies itself. This is a little tricky to pull off with pip as most recent libraries have wheels so you end up needing to look for interesting example or use --no-binary to avoid choosing the wheel.

setuptools is rather special and pip often pre-seeds that one, but that's legacy choice that future pips/python versions may stop doing entirely. I think only recent python versions/pip avoid pre-seeding setuptools.

@burgholzer
Copy link
Author


No, the build isolation setting is not transitive. It only holds for the current package. At least that's what I've gotten to learn from pip.

I don't follow this. My experience using pip is it is transitive and I've just confirmed this. The easiest way is to test this manually by installing library A that has dependency B which depends on some build dependency and avoid installing it yourself. pip will crash here even though A does not have any build dependencies itself. This is a little tricky to pull off with pip as most recent libraries have wheels so you end up needing to look for interesting example or use --no-binary to avoid choosing the wheel.

setuptools is rather special and pip often pre-seeds that one, but that's legacy choice that future pips/python versions may stop doing entirely. I think only recent python versions/pip avoid pre-seeding setuptools.

Yeah. That was totally a misconception on my end based on the fact that up until the most recent versions of pip, setuptools was always special cased. So I guess I never really noticed the explicit dependency there.
Sorry for that.
Your example as well as Charlie's from above perfectly illustrate simple cases for when my assumption from above breaks down. 👍🏻

@notatallshaw
Copy link
Contributor

Haha yeah. That matches my diagnosis above. Because of the heuristics (which are clearly off a bit), we're fully resolving pytest-cov>=4 before we even look at uv_reproducer[test], which adds the extra constraint.

As someone thinking about Python packaging resolution for awhile I reallly find the optionality of extras to be very very annoying, it makes writing all resolvers significantly more complex.

@charliermarsh
Copy link
Member

Ok, I tested it out on your project, and #3133 should fix it. I think there's a "deeper" fix I want to pursue here for some other pathological cases, but that should be good for now.

charliermarsh added a commit that referenced this issue Apr 19, 2024
## Summary

We weren't setting a priority for editables, so they were being visited
last.

I think there's still a problem whereby we're not aggressive enough in
visiting recursive extras (and, in fact, that's making it really hard to
write a test -- I wrote a test, but the most-reduced case still fails,
and I'd need to add a layer of indirection to make it
fail-on-main-but-pass-on-this-branch), but that problem likely already
existed on main prior to #3087, so I just want to get this quick fix out
now.

Closes #3127.

## Test Plan

- `git clone https://github.com/cda-tum/mqt-core.git`
- `cargo run venv`
- `cargo run pip install 'scikit-build-core[pyproject]>=0.8.1'
'setuptools_scm>=7' 'pybind11>=2.12' --resolution=lowest-direct`
- `cargo run pip install --no-build-isolation
'-ve.[test,qiskit,evaluation,coverage]' --resolution=lowest-direct`
@burgholzer
Copy link
Author

Yeah. I can confirm that this fixes all the regressions we were seeing.
Thanks for the extremely fast fix. Keep up the good work 🎉
It's really cool to follow these developments!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants