# Tox (http://tox.testrun.org/) 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] envlist = flake8, mypy, py37, py38, py39, py310, py311 # Other valid environments are: # docs # release # clean # bump # Don't error out if a user hasn't installed all python versions. skip_missing_interpreters = true [testenv] passenv = WITH_EXTRAS deps = coverage pytest pytest-cov pytest-mock hypothesis extras = {env:WITH_EXTRAS:} commands = # Doctests {envpython} -m doctest -o IGNORE_EXCEPTION_DETAIL docs/howitworks.rst pytest README.rst docs/examples.rst pytest --doctest-modules {envsitepackagesdir}/natsort # Full test suite. Allow the user to pass command-line objects. pytest --hypothesis-profile=slow-tests --tb=short --cov {envsitepackagesdir}/natsort --cov-report term-missing {posargs:} # Check code quality. [testenv:flake8] deps = flake8 flake8-import-order flake8-bugbear pep8-naming check-manifest twine commands = {envpython} setup.py sdist pip wheel . -w dist flake8 check-manifest --ignore ".github*,*.md,.coveragerc" twine check dist/* skip_install = true # Type checking [testenv:mypy] deps = mypy hypothesis pytest pytest-mock fastnumbers>=5.0.1 typing_extensions commands = mypy --strict natsort tests skip_install = true # Build documentation. # sphinx and sphinx_rtd_theme not in docs/requirements.txt because they # will already be installed on readthedocs. [testenv:docs] deps = sphinx sphinx_rtd_theme commands = {envpython} setup.py build_sphinx skip_install = true # Bump version [testenv:bump] passenv = HOME deps = bump2version commands = {envpython} dev/bump.py {posargs:} skip_install = true # Release the code to PyPI [testenv:release] deps = twine commands = {envpython} setup.py sdist --format=gztar bdist_wheel twine upload --skip-existing dist/* skip_install = true # Clean up the working directory [testenv:clean] deps = commands = {envpython} dev/clean.py skip_install = true # Get GitHub actions to run the correct tox environment [gh-actions] python = 3.7: py37 3.8: py38 3.9: py39 3.10: py310 3.11: py311