blob: 0a58c95113059f9556d71fe5c3fa88d250c6b547 [file] [log] [blame]
[tox]
minversion = 3.8.0
skip_missing_interpreters = true
envlist =
py35,
py36,
py37,
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
deps = -rtest-requirements.txt
commands = python -m pytest {posargs}
cov: python -m pytest {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 =
py35,
py36,
py37,
parallel_show_output = True
[testenv:lint]
description = check the code style
basepython = python3.7
commands = flake8 {posargs}
[testenv:type]
description = type check ourselves
basepython = python3.7
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 scripts/stubtest.py scripts/mypyc
[testenv:docs]
description = invoke sphinx-build to build the HTML docs
basepython = python3.7
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)'