Skip to content

Commit

Permalink
tox: attempt to fix Python versions in testenvs using tox-gh
Browse files Browse the repository at this point in the history
  • Loading branch information
deeenes committed Mar 3, 2025
1 parent 197dd2a commit 73ba23a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ jobs:
uv sync --all-extras
uv pip install codecov
uv tool install \
--python-preference only-managed \
--python ${{ matrix.python }} \
--python-preference only-managed ${{ matrix.python }} \
tox --with tox-uv --with tox-gh
Expand Down
26 changes: 18 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ filename = *.py

[gh]
python =
3.9: 3.9
3.10: 3.10
3.11: 3.11
3.12: 3.12
3.13: 3.13, covclean, lint, coverage, readme
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313, covclean, lint, coverage, readme

[pytest]
python_files = test_*.py
Expand All @@ -42,7 +42,7 @@ skip_missing_interpreters = true
envlist =
covclean
lint
{3.9,3.10,3.11,3.12,3.13}-{linux,macos}
py{39,310,311,311,313}
coverage
readme
docs
Expand All @@ -51,6 +51,12 @@ envlist =
platform =
linux: linux
macos: (macos|osx|darwin)
base_python =
py39: python3.9
py310: python3.10
py311: python3.11
py312: python3.12
py313: python3.13
deps =
pytest
pytest-mock
Expand All @@ -63,12 +69,16 @@ deps =
# log level ERROR because we print out info from fixture and -s also prints useless stuff from R
setenv =
OMNIPATH_AUTOLOAD = false
{3.9-linux}: _PYTEST_TOX_POSARGS=--test-server --log-cli-level=ERROR
passenv = TOXENV,CI,CODECOV_*,GITHUB_ACTIONS
usedevelop = true
commands =
pytest --cov --cov-append --cov-config={toxinidir}/.coveragerc --ignore docs/ {posargs:-vv {env:_PYTEST_TOX_POSARGS:}}

[testenv:py313]
setenv =
_PYTEST_TOX_POSARGS=--test-server --log-cli-level=ERROR


[testenv:covclean]
description = Clean coverage files.
deps = coverage
Expand All @@ -88,7 +98,7 @@ deps =
coverage
diff_cover
skip_install = true
depends = {3.9,3.10,3.11,3.12,3.13}-{linux,macos}
depends = py{39,310,311,312,313}
parallel_show_output = True
commands =
coverage report --omit="tox/*"
Expand Down

0 comments on commit 73ba23a

Please sign in to comment.