| 1 | # tox (https://tox.readthedocs.io/) is a tool for running tests |
| 2 | # in multiple virtualenvs. This configuration file will run the |
| 3 | # test suite on all supported python versions. To use it, "pip install tox" |
| 4 | # and then run "tox" from this directory. |
| 5 | |
| 6 | [tox] |
| 7 | skipsdist = True |
| 8 | envlist = py38, py39, py310, py311, py312, ruff, build |
| 9 | |
| 10 | [testenv] |
| 11 | setenv = TMPDIR={envtmpdir} |
| 12 | passenv = TZ |
| 13 | deps = -e .[test] |
| 14 | commands = |
| 15 | pytest --basetemp="{envtmpdir}" {posargs} |
| 16 | |
| 17 | [testenv:ruff] |
| 18 | deps = ruff |
| 19 | skip_install = True |
| 20 | commands = |
| 21 | ruff format |
| 22 | ruff check --fix |
| 23 | |
| 24 | [testenv:build] |
| 25 | deps = |
| 26 | build |
| 27 | twine |
| 28 | pip-tools |
| 29 | commands = |
| 30 | pip-compile |
| 31 | python -c "from shutil import rmtree; rmtree('dist', ignore_errors=True)" |
| 32 | python -m build . |
| 33 | twine check dist/* |
| 34 | |
| 35 | [testenv:docs] |
| 36 | skip_install = True |
| 37 | changedir = docs |
| 38 | deps = |
| 39 | allowlist_externals = |
| 40 | make |
| 41 | git |
| 42 | commands = |
| 43 | make cleanhtml |
| 44 | # see https://stackoverflow.com/a/59897351/1320237 |
| 45 | make html SPHINXOPTS="-W --keep-going -n" |
| 46 |