| [tox] |
| minversion = 3.8.0 |
| skip_missing_interpreters = {env:TOX_SKIP_MISSING_INTERPRETERS:True} |
| envlist = |
| py36, |
| py37, |
| py38, |
| py39, |
| py310, |
| lint, |
| type, |
| docs, |
| isolated_build = true |
| |
| [testenv] |
| description = run the test driver with {basepython} |
| setenv = cov: COVERAGE_FILE={toxworkdir}/.coverage.{envname} |
| passenv = PYTEST_XDIST_WORKER_COUNT PROGRAMDATA PROGRAMFILES(X86) |
| deps = -rtest-requirements.txt |
| commands = python -m pytest --durations 100 {posargs} |
| cov: python -m pytest --durations 100 {posargs: --cov mypy --cov-config setup.cfg} |
| |
| |
| [testenv:coverage] |
| description = [run locally after tests]: combine coverage data and create report |
| deps = |
| coverage >= 4.5.1, < 5 |
| diff_cover >= 1.0.5, <2 |
| skip_install = True |
| passenv = |
| {[testenv]passenv} |
| DIFF_AGAINST |
| setenv = COVERAGE_FILE={toxworkdir}/.coverage |
| commands = |
| coverage combine --rcfile setup.cfg |
| coverage report -m --rcfile setup.cfg |
| coverage xml -o {toxworkdir}/coverage.xml --rcfile setup.cfg |
| coverage html -d {toxworkdir}/htmlcov --rcfile setup.cfg |
| diff-cover --compare-branch {env:DIFF_AGAINST:origin/master} {toxworkdir}/coverage.xml |
| depends = |
| py36, |
| py37, |
| py38, |
| py39, |
| py310, |
| parallel_show_output = True |
| |
| [testenv:lint] |
| description = check the code style |
| commands = |
| flake8 {posargs} |
| black --check --diff --color . |
| isort --check --diff --color . |
| |
| [testenv:type] |
| description = type check ourselves |
| commands = |
| python -m mypy --config-file mypy_self_check.ini -p mypy -p mypyc |
| python -m mypy --config-file mypy_self_check.ini misc/proper_plugin.py |
| |
| [testenv:docs] |
| description = invoke sphinx-build to build the HTML docs |
| deps = -rdocs/requirements-docs.txt |
| commands = |
| sphinx-build -d "{toxworkdir}/docs_doctree" docs/source "{toxworkdir}/docs_out" --color -W -bhtml {posargs} |
| python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))' |
| |
| [testenv:dev] |
| description = generate a DEV environment, that has all project libraries |
| usedevelop = True |
| deps = |
| -rtest-requirements.txt |
| -rdocs/requirements-docs.txt |
| commands = |
| python -m pip list --format=columns |
| python -c 'import sys; print(sys.executable)' |