Skip to content

fix(tox): run each tox env on its own interpreter - #1391

Open
Moisan wants to merge 1 commit into
anchore:mainfrom
Moisan:fix/tox-per-env-interpreter
Open

Moisan wants to merge 1 commit into
anchore:mainfrom
Moisan:fix/tox-per-env-interpreter

Conversation

@Moisan

@Moisan Moisan commented Oct 17, 2026

Copy link
Copy Markdown

The tox commands call uv sync and uv run, which ignore the VIRTUAL_ENV that tox activates and use the project's .venv instead. Every tox env (py313, py314) therefore ran the unit tests on whichever interpreter built .venv (3.13 in CI), so 3.14 was never actually tested.

Point UV_PROJECT_ENVIRONMENT at the tox env dir so uv installs into and runs from the env tox created for that interpreter.

Evidence from CI

From the Test (py314) job on the latest main run (run 38946725826):

py314: commands[1]> uv run pytest --cov vunnel -v --durations=10 tests/unit/
warning: `VIRTUAL_ENV=.tox/py314` does not match the project environment path `.venv` and will be ignored
platform linux -- Python 3.13.16, pytest-9.1.1, pluggy-1.6.0 -- /home/runner/_work/vunnel/vunnel/.venv/bin/python
py314: OK

The job is labelled py314, but the tests run on 3.13.16 from .venv.

With this change, running tox -e py313 and tox -e py314 locally reports 3.13.16 from .tox/py313 and 3.14.8 from .tox/py314, and the unit tests pass in both.

The tox commands call `uv sync` and `uv run`, which ignore the
VIRTUAL_ENV that tox activates and use the project's .venv instead.
Every tox env (py313, py314) therefore ran the unit tests on whichever
interpreter built .venv (3.13 in CI), so 3.14 was never actually tested.

Point UV_PROJECT_ENVIRONMENT at the tox env dir so uv installs into and
runs from the env tox created for that interpreter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thierry Moisan <thierry.moisan@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant