-
-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Issue
When using a relative work_dir in combination with the change_dir option, the path resolution in tox-uv is incorrect.
Re-Open from #144 that was closed due to broken reproduction, but not re-opened after the reproduction was fixed.
Environment
Provide at least:
- OS: Arch Linux/Debian Trixie
Output of pip list of the host Python, where tox is installed
Package Version
------------- -------
cachetools 6.2.2
chardet 5.2.0
colorama 0.4.6
distlib 0.4.0
filelock 3.20.0
packaging 25.0
platformdirs 4.5.0
pluggy 1.6.0
pyproject-api 1.10.0
tox 4.32.0
tox-uv 1.29.0
uv 0.9.9
virtualenv 20.35.4Output of running tox
Output of tox -rvv
# tox
.pkg: _optional_hooks> python /home/lucas/tox-uv-test/.venv/lib/python3.14/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: get_requires_for_build_sdist> python /home/lucas/tox-uv-test/.venv/lib/python3.14/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: build_sdist> python /home/lucas/tox-uv-test/.venv/lib/python3.14/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
py: install_package> .venv/bin/uv pip install --reinstall --no-deps [email protected]/.tmp/package/2/tox_uv_test-0.1.0.tar.gz
py: OK (0.78 seconds)
congratulations :) (0.81 seconds)Minimal example
uv init
uv add tox tox-uv
uv lock[tox]
toxworkdir=.tox
[testenv:demo]
runner = uv-venv-lock-runner
changedir={toxinidir}/demo
skip_install = true
commands=
python -c 'print("{toxworkdir}")'# tox -e demo
demo: venv> .venv/bin/uv venv -p /home/lucas/tox-uv-test/.venv/bin/python --allow-existing --python-preference system .tox/demo
demo: uv-sync> uv sync --locked --python-preference system -p /home/lucas/tox-uv-test/.venv/bin/python
demo: commands[0] /home/lucas/tox-uv-test/demo> python -c 'print(".tox")'
demo: Exception running subprocess [Errno 2] No such file or directory: '.tox/demo/bin/python'
demo: exit 2 (0.00 seconds) /home/lucas/tox-uv-test/demo> python -c 'print(".tox")'
demo: FAIL code 2 (0.07=setup[0.07]+cmd[0.00] seconds)
evaluation failed :( (0.09 seconds)Workaround
You can build the correct path from the built-in variables as follows, but must explicitly allow it:
[tox]
toxworkdir=.tox
[testenv:demo]
runner = uv-venv-lock-runner
changedir={toxinidir}/demo
skip_install = true
commands=
{tox_root}/{env_bin_dir}/python -c 'print("{toxworkdir}")'
allowlist_externals=
{tox_root}/{env_bin_dir}/pythonMetadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working