tox-uv
tox-uv copied to clipboard
Lock runner fails with non-standard resolution mode
Issue
When creating a lock file with non-standard resolution, e.g. uv lock --resolution=lowest-direct and then when running with uv-venv-lock-runner, the run fails due to the --locked flag.
Environment
Provide at least:
- OS: macos
installed with uv tool install tox --with tox-uv so cd ~/.local/share/uv/tools/tox/ && ./bin/uv pip list
Output of pip list of the host Python, where tox is installed
Package Version
------------- -------
cachetools 5.5.2
chardet 5.2.0
colorama 0.4.6
distlib 0.3.9
filelock 3.18.0
packaging 24.2
platformdirs 4.3.7
pluggy 1.5.0
pyproject-api 1.9.0
tox 4.25.0
tox-uv 1.25.0
uv 0.6.12
virtualenv 20.30.0
Output of running tox
Output of tox -rvv
Creating virtual environment at: .tox/py3.13
DEBUG Assessing Python executable as base candidate: ~/.local/share/uv/python/cpython-3.13.2-macos-aarch64-none/bin/python3.13
DEBUG Using base executable for virtual environment: ~/.local/share/uv/python/cpython-3.13.2-macos-aarch64-none/bin/python3.13
DEBUG Allowing existing directory
py3.13: 92 I exit 0 (0.01 seconds) ~/git/geturl> ~/.local/share/uv/tools/tox/bin/uv venv -p ~/.local/share/uv/tools/tox/bin/python --allow-existing -v --python-preference system ~/git/geturl/.tox/py3.13 pid=46344 [tox/execute/api.py:294]
py3.13: 93 W uv-sync> uv sync --locked --python-preference system --no-default-groups -v --no-editable --reinstall-package geturl --group dev -p ~/.local/share/uv/tools/tox/bin/python [tox/tox_env/api.py:434]
DEBUG uv 0.6.12 (e4e03833f 2025-04-02)
DEBUG Found project root: `~/git/geturl`
DEBUG No workspace root found, using project root
DEBUG Acquired lock for `~/git/geturl`
DEBUG Using Python request `~/.local/share/uv/tools/tox/bin/python` from explicit request
DEBUG Checking for Python environment at `.tox/py3.13`
DEBUG The virtual environment's Python version satisfies `~/.local/share/uv/tools/tox/bin/python`
DEBUG Released lock at `/var/folders/vz/xwxqzqx153qcxljp_4sb9shw0000gn/T/uv-e2664383b09fc806.lock`
DEBUG Using request timeout of 30s
Ignoring existing lockfile due to change in resolution mode: `lowest-direct` vs. `highest`
DEBUG No static `pyproject.toml` available for: geturl @ file://~/git/geturl (DynamicField("version"))
DEBUG Acquired lock for `~/Library/Caches/uv/sdists-v9/editable/848f05ec6cda633e`
DEBUG Computed cache info: Some(Timestamp(SystemTime { tv_sec: 1743674211, tv_nsec: 683535118 })), None, None, {}, {"src": Some(Timestamp(Timestamp(SystemTime { tv_sec: 1718882593, tv_nsec: 672294794 })))}
DEBUG Preparing metadata for: geturl @ file://~/git/geturl
DEBUG No workspace root found, using project root
DEBUG Assessing Python executable as base candidate: ~/.local/share/uv/python/cpython-3.13.2-macos-aarch64-none/bin/python3.13
DEBUG Using base executable for virtual environment: ~/.local/share/uv/python/cpython-3.13.2-macos-aarch64-none/bin/python3.13
DEBUG Ignoring empty directory
DEBUG Resolving build requirements
DEBUG Solving with installed Python version: 3.13.2
DEBUG Solving with target Python version: >=3.13.2
DEBUG Adding direct dependency: flit-core>=3.2, <4
DEBUG Found fresh response for: https://pypi.org/simple/flit-core/
DEBUG Searching for a compatible version of flit-core (>=3.2, <4)
DEBUG Selecting: flit-core==3.12.0 [compatible] (flit_core-3.12.0-py3-none-any.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/f2/65/b6ba90634c984a4fcc02c7e3afe523fef500c4980fec67cc27536ee50acf/flit_core-3.12.0-py3-none-any.whl.metadata
DEBUG Tried 1 versions: flit-core 1
DEBUG marker environment resolution took 0.001s
DEBUG Installing in flit-core==3.12.0 in ~/Library/Caches/uv/builds-v0/.tmpOnA19H
DEBUG Registry requirement already cached: flit-core==3.12.0
DEBUG Installing build requirement: flit-core==3.12.0
DEBUG Creating PEP 517 build environment
DEBUG Calling `flit_core.buildapi.get_requires_for_build_editable()`
DEBUG No workspace root found, using project root
DEBUG Installing extra requirements for build backend
DEBUG Solving with installed Python version: 3.13.2
DEBUG Solving with target Python version: >=3.13.2
DEBUG Adding direct dependency: flit-core>=3.2, <4
DEBUG Adding direct dependency: joblib>=1.0.0
DEBUG Searching for a compatible version of flit-core (>=3.2, <4)
DEBUG Selecting: flit-core==3.12.0 [compatible] (flit_core-3.12.0-py3-none-any.whl)
DEBUG Found fresh response for: https://pypi.org/simple/joblib/
DEBUG Searching for a compatible version of joblib (>=1.0.0)
DEBUG Selecting: joblib==1.4.2 [compatible] (joblib-1.4.2-py3-none-any.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/91/29/df4b9b42f2be0b623cbd5e2140cafcaa2bef0759a00b7b70104dcfe2fb51/joblib-1.4.2-py3-none-any.whl.metadata
DEBUG Tried 2 versions: flit-core 1, joblib 1
DEBUG marker environment resolution took 0.000s
DEBUG Installing in joblib==1.4.2, flit-core==3.12.0 in ~/Library/Caches/uv/builds-v0/.tmpOnA19H
DEBUG Registry requirement already cached: joblib==1.4.2
DEBUG Requirement already installed: flit-core==3.12.0
DEBUG Installing build requirement: joblib==1.4.2
DEBUG Calling `flit_core.buildapi.prepare_metadata_for_build_editable()`
DEBUG Prepared metadata for: geturl @ file://~/git/geturl
DEBUG No workspace root found, using project root
DEBUG Released lock at `~/Library/Caches/uv/sdists-v9/editable/848f05ec6cda633e/.lock`
DEBUG Solving with installed Python version: 3.13.2
DEBUG Solving with target Python version: >=3.9
DEBUG Adding direct dependency: geturl*
DEBUG Adding direct dependency: geturl:dev*
DEBUG Searching for a compatible version of geturl @ file://~/git/geturl (*)
DEBUG Adding direct dependency: joblib>=1.0.0
DEBUG Searching for a compatible version of geturl @ file://~/git/geturl (*)
DEBUG Adding direct dependency: geturl:dev==0.4.2
DEBUG Searching for a compatible version of geturl @ file://~/git/geturl (==0.4.2)
DEBUG Adding direct dependency: mypy>=1.15.0
DEBUG Adding direct dependency: pytest>=8.3.5
DEBUG Adding direct dependency: ruff>=0.11.2
DEBUG Found fresh response for: https://pypi.org/simple/joblib/
DEBUG Searching for a compatible version of joblib (>=1.0.0)
DEBUG Selecting: joblib==1.4.2 [compatible] (joblib-1.4.2-py3-none-any.whl)
DEBUG Found fresh response for: https://pypi.org/simple/pytest/
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/91/29/df4b9b42f2be0b623cbd5e2140cafcaa2bef0759a00b7b70104dcfe2fb51/joblib-1.4.2-py3-none-any.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/30/3d/64ad57c803f1fa1e963a7946b6e0fea4a70df53c1a7fed304586539c2bac/pytest-8.3.5-py3-none-any.whl.metadata
DEBUG Found fresh response for: https://pypi.org/simple/mypy/
DEBUG Searching for a compatible version of mypy (>=1.15.0)
DEBUG Selecting: mypy==1.15.0 [compatible] (mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/68/f8/65a7ce8d0e09b6329ad0c8d40330d100ea343bd4dd04c4f8ae26462d0a17/mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl.metadata
DEBUG Adding transitive dependency for mypy==1.15.0: mypy-extensions>=1.0.0
DEBUG Adding transitive dependency for mypy==1.15.0: tomli{python_full_version < '3.11'}>=1.1.0
DEBUG Adding transitive dependency for mypy==1.15.0: typing-extensions>=4.6.0
DEBUG Searching for a compatible version of pytest (>=8.3.5)
DEBUG Selecting: pytest==8.3.5 [compatible] (pytest-8.3.5-py3-none-any.whl)
DEBUG Adding transitive dependency for pytest==8.3.5: colorama{sys_platform == 'win32'}*
DEBUG Adding transitive dependency for pytest==8.3.5: exceptiongroup{python_full_version < '3.11'}>=1.0.0rc8
DEBUG Adding transitive dependency for pytest==8.3.5: iniconfig*
DEBUG Adding transitive dependency for pytest==8.3.5: packaging*
DEBUG Adding transitive dependency for pytest==8.3.5: pluggy>=1.5, <2
DEBUG Adding transitive dependency for pytest==8.3.5: tomli{python_full_version < '3.11'}>=1
DEBUG Found fresh response for: https://pypi.org/simple/mypy-extensions/
DEBUG Found fresh response for: https://pypi.org/simple/tomli/
DEBUG Found fresh response for: https://pypi.org/simple/typing-extensions/
DEBUG Found fresh response for: https://pypi.org/simple/colorama/
DEBUG Found fresh response for: https://pypi.org/simple/packaging/
DEBUG Found fresh response for: https://pypi.org/simple/iniconfig/
DEBUG Found fresh response for: https://pypi.org/simple/pluggy/
DEBUG Found fresh response for: https://pypi.org/simple/exceptiongroup/
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/e0/86/39b65d676ec5732de17b7e3c476e45bb80ec64eb50737a8dce1a4178aba1/typing_extensions-4.13.0-py3-none-any.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/2a/e2/5d3f6ada4297caebe1a2add3b126fe800c96f56dbe5d1988a2cbe0b267aa/mypy_extensions-1.0.0-py3-none-any.whl.metadata
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl.metadata
DEBUG Found fresh response for: https://pypi.org/simple/ruff/
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl.metadata
DEBUG Searching for a compatible version of ruff (>=0.11.2)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/2c/e1/e6716421ea10d38022b952c159d5161ca1193197fb744506875fbb87ea7b/iniconfig-2.1.0-py3-none-any.whl.metadata
DEBUG Selecting: ruff==0.11.2 [compatible] (ruff-0.11.2-py3-none-linux_armv6l.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/62/99/102578506f0f5fa29fd7e0df0a273864f79af044757aef73d1cae0afe6ad/ruff-0.11.2-py3-none-linux_armv6l.whl.metadata
DEBUG Searching for a compatible version of mypy-extensions (>=1.0.0)
DEBUG Selecting: mypy-extensions==1.0.0 [compatible] (mypy_extensions-1.0.0-py3-none-any.whl)
DEBUG Searching for a compatible version of tomli{python_full_version < '3.11'} (>=1.1.0)
DEBUG Selecting: tomli==2.2.1 [compatible] (tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl)
DEBUG Adding transitive dependency for tomli==2.2.1: tomli==2.2.1
DEBUG Adding transitive dependency for tomli==2.2.1: tomli{python_full_version < '3.11'}==2.2.1
DEBUG Searching for a compatible version of tomli (==2.2.1)
DEBUG Selecting: tomli==2.2.1 [compatible] (tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/43/ca/75707e6efa2b37c77dadb324ae7d9571cb424e61ea73fad7c56c2d14527f/tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl.metadata
DEBUG Searching for a compatible version of tomli{python_full_version < '3.11'} (==2.2.1)
DEBUG Selecting: tomli==2.2.1 [compatible] (tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl)
DEBUG Searching for a compatible version of typing-extensions (>=4.6.0)
DEBUG Selecting: typing-extensions==4.13.0 [compatible] (typing_extensions-4.13.0-py3-none-any.whl)
DEBUG Searching for a compatible version of colorama{sys_platform == 'win32'} (*)
DEBUG Selecting: colorama==0.4.6 [compatible] (colorama-0.4.6-py2.py3-none-any.whl)
DEBUG Adding transitive dependency for colorama==0.4.6: colorama==0.4.6
DEBUG Adding transitive dependency for colorama==0.4.6: colorama{sys_platform == 'win32'}==0.4.6
DEBUG Searching for a compatible version of colorama (==0.4.6)
DEBUG Selecting: colorama==0.4.6 [compatible] (colorama-0.4.6-py2.py3-none-any.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl.metadata
DEBUG Searching for a compatible version of colorama{sys_platform == 'win32'} (==0.4.6)
DEBUG Selecting: colorama==0.4.6 [compatible] (colorama-0.4.6-py2.py3-none-any.whl)
DEBUG Searching for a compatible version of exceptiongroup{python_full_version < '3.11'} (>=1.0.0rc8)
DEBUG Selecting: exceptiongroup==1.2.2 [compatible] (exceptiongroup-1.2.2-py3-none-any.whl)
DEBUG Adding transitive dependency for exceptiongroup==1.2.2: exceptiongroup==1.2.2
DEBUG Adding transitive dependency for exceptiongroup==1.2.2: exceptiongroup{python_full_version < '3.11'}==1.2.2
DEBUG Searching for a compatible version of exceptiongroup (==1.2.2)
DEBUG Selecting: exceptiongroup==1.2.2 [compatible] (exceptiongroup-1.2.2-py3-none-any.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/02/cc/b7e31358aac6ed1ef2bb790a9746ac2c69bcb3c8588b41616914eb106eaf/exceptiongroup-1.2.2-py3-none-any.whl.metadata
DEBUG Searching for a compatible version of exceptiongroup{python_full_version < '3.11'} (==1.2.2)
DEBUG Selecting: exceptiongroup==1.2.2 [compatible] (exceptiongroup-1.2.2-py3-none-any.whl)
DEBUG Searching for a compatible version of iniconfig (*)
DEBUG Selecting: iniconfig==2.1.0 [compatible] (iniconfig-2.1.0-py3-none-any.whl)
DEBUG Searching for a compatible version of packaging (*)
DEBUG Selecting: packaging==24.2 [compatible] (packaging-24.2-py3-none-any.whl)
DEBUG Searching for a compatible version of pluggy (>=1.5, <2)
DEBUG Selecting: pluggy==1.5.0 [compatible] (pluggy-1.5.0-py3-none-any.whl)
DEBUG Tried 13 versions: colorama 1, exceptiongroup 1, geturl 1, iniconfig 1, joblib 1, mypy 1, mypy-extensions 1, packaging 1, pluggy 1, pytest 1, ruff 1, tomli 1, typing-extensions 1
DEBUG all marker environments resolution took 0.002s
Resolved 13 packages in 107ms
error: The lockfile at `uv.lock` needs to be updated, but `--locked` was provided. To update the lockfile, run `uv lock`.
py3.13: 237 C exit 2 (0.14 seconds) ~/git/geturl> uv sync --locked --python-preference system --no-default-groups -v --no-editable --reinstall-package geturl --group dev -p ~/.local/share/uv/tools/tox/bin/python pid=46345 [tox/execute/api.py:294]
py3.13: FAIL code 2 (0.16 seconds)
evaluation failed :( (0.19 seconds)
Minimal example
uv add 'joblib>=1.0.0'
uv lock --resolution=lowest-direct
then
[tox]
min_version = 4.0
env_list =
py313
[testenv]
runner = uv-venv-lock-runner
uv_resolution = lowest-direct # does not help
i'd suggest either a uv_sync_unlocked = true flag or adding the uv_resolution to uv sync
I'll note that uv_sync_flags is allowed, but I made #205 to fix this, if you want to give it a try.