diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index a3a132b12..f90b508f2 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -22,7 +22,7 @@ jobs: with: python-version: '3.11' architecture: 'x64' - - run: pip install tox tox-gh-actions tox-uv + - run: pip install tox tox-gh tox-uv - run: tox - uses: codecov/codecov-action@v4 with: diff --git a/pyproject.toml b/pyproject.toml index d8f2a3b60..8949da76b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -173,3 +173,66 @@ ignore = [ [tool.ruff.pydocstyle] convention = "numpy" + +[tool.tox] +requires = ["tox>=4.19"] +env_list = [ + "3.13", + "3.12", + "3.11", + "3.10", + "3.9", + "3.8", + "3.7", + "docs", +] + +[tool.tox.env_run_base] +description = "Run test under {base_python}" +package = "editable" +extras = [ + "test", +] +pass_env = [ + "CI", + "CODACY_*", + "CODECOV_*", + "GITHUB_*", + "TOXENV", +] +set_env = { DEBUG = "1" } +commands = [[ + "pytest", + "--pyargs", + "tests", + "--cov", + "--cov-report", + "term", + "--cov-report", + "xml", + "--cov-config={toxinidir}/pyproject.toml" +]] + +[tool.tox.env.docs] +description = "invoke sphinx-build to build the HTML docs" +extras = [ + "docs", +] +commands = [[ + "make", + "-C", + "{toxinidir}/docs", + "html" +]] +allowlist_externals = [ + "make", +] + +[tool.tox.gh.python] +"3.13" = ["3.13"] +"3.12" = ["3.12"] +"3.11" = ["3.11"] +"3.10" = ["3.10"] +"3.9" = ["3.9"] +"3.8" = ["3.8"] +"3.7" = ["3.7"] diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 38490aab1..000000000 --- a/tox.ini +++ /dev/null @@ -1,42 +0,0 @@ -[tox] -requires = - tox>=4.2 -env_list = - py311 - py310 - py39 - py38 - py37 - -[testenv] -package = editable -extras = - test -pass_env = - CI - CODACY_* - CODECOV_* - GITHUB_* - TOXENV -set_env = - DEBUG = 1 -commands = - pytest --pyargs tests --cov --cov-report term --cov-report xml --cov-config={toxinidir}/pyproject.toml - -[testenv:docs] -description = invoke sphinx-build to build the HTML docs -extras = - docs -commands = - make -C "{toxinidir}/docs" html -allowlist_externals = - make - yarn - -[gh-actions] -python = - 3.7: py37 - 3.8: py38 - 3.9: py39 - 3.10: py310 - 3.11: py311