# This tox config expects the tox-uv plugin
#   Install:            uv tool install tox --with tox-uv
#   Run:                uv run -p 3.11 tox run -vvv -e python3.11
#   For all versions:   pyv=("3.11" "3.12" "3.13"); for v in "${pyv[@]}"; do uv run -p $v tox run -vvv -e python$v; done
# See https://github.com/tox-dev/tox-uv
[tox]
requires =
    tox>=4.2
    tox-uv>=1.11.3
env_list = python{3.11,3.12,3.13}
skip_missing_interpreters = true

[testenv]
# uv runner uses uv sync
description = Runs tests with coverage for {base_python}
runner = uv-venv-runner
skip_install = true
allowlist_externals =
    pytest
with_dev = true
commands =
    uv python pin {base_python}
    uv run python --version
    uv run python -m pytest {tty:--color=yes} {posargs: \
        --cov=src/uv_demo \
        --cov-config=pyproject.toml --no-cov-on-fail --cov-report term-missing:skip-covered --cov-context=test \
        --cov-report html:{env_tmp_dir}{/}htmlcov --cov-report html \
        tests
    }
