# tox (https://tox.readthedocs.io/) is a tool for running tests # in multiple virtualenvs. This configuration file will run the # test suite on all supported python versions. To use it, "pip install tox" # and then run "tox" from this directory. [tox] # we use any Python 3 envlist = py3,mypy,check_style skip_missing_interpreters=true [testenv] deps = -r{toxinidir}/test-requirements.txt pytest==7.1.2 commands= pytest [testenv:mypy] description = Run type checks. skip_install = True deps = -r{toxinidir}/test-requirements.txt mypy==0.960 commands= mypy sphinx_reredirects [testenv:check_style] description = Run style checks. Do not modify files. skip_install = True deps = isort==5.10.1 black==22.3.0 flake8==4.0.1 commands = ; import order compatible with black formatter isort --check-only --diff --profile black sphinx_reredirects tests setup.py black --check --diff sphinx_reredirects tests setup.py ; Make Flake8 linter compatible with Black formatter ; https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8 flake8 --ignore E203 --max-line-length 88 sphinx_reredirects tests setup.py [testenv:fix_style] description = Run and fix style (modify files). skip_install = True deps = isort==5.10.1 black==22.3.0 flake8==4.0.1 commands = isort --profile black sphinx_reredirects tests setup.py black sphinx_reredirects tests setup.py flake8 --ignore E203 --max-line-length 88 sphinx_reredirects tests setup.py [testenv:docs] description = Build docs skip_install = True deps = sphinx==5.0.1 sphinx_documatt_theme commands = ; -W turn warnings into errors ; -q be quiet sphinx-build -b html -q -W docs public [testenv:build] description = Package and release isolated_build = True skip_install = True deps = build==0.8.0 allowlist_externals = rm commands = rm -rf dist python -m build [testenv:publish] description = Publish the package you have been developing to a package index server. By default, it uses testpypi. If you really want to publish your package to be publicly accessible in PyPI, use the `-- --repository pypi` option. skip_install = True changedir = {toxinidir} passenv = TWINE_USERNAME TWINE_PASSWORD TWINE_REPOSITORY deps = twine commands = python -m twine check dist/* python -m twine upload {posargs:--repository {env:TWINE_REPOSITORY:testpypi}} dist/*