11[tox]
2- minversion = 3.5.1
2+ minversion = 3.8.0
33skip_missing_interpreters = true
4- envlist = py35,
5- py36,
6- py37,
7- lint,
8- type,
9- docs
4+ envlist =
5+ py35,
6+ py36,
7+ py37,
8+ lint,
9+ type,
10+ docs,
1011isolated_build = true
1112
1213[testenv]
1314description = run the test driver with {basepython}
15+ setenv = cov: COVERAGE_FILE ={toxworkdir}/.coverage.{envname}
1416passenv = PYTEST_XDIST_WORKER_COUNT NEWSEMANAL
1517deps = -rtest-requirements.txt
16- commands = pytest {posargs}
18+ commands = python -m pytest {posargs}
19+ cov: python -m pytest {posargs: --cov mypy --cov-config setup.cfg}
20+
1721
18- [testenv:.package]
22+ [testenv:coverage]
23+ description = [run locally after tests]: combine coverage data and create report
1924deps =
25+ coverage >= 4.5.1, < 5
26+ diff_cover >= 1.0.5, <2
27+ skip_install = True
28+ passenv =
29+ {[testenv]passenv}
30+ DIFF_AGAINST
31+ setenv = COVERAGE_FILE ={toxworkdir}/.coverage
32+ commands =
33+ coverage combine --rcfile setup.cfg
34+ coverage report -m --rcfile setup.cfg
35+ coverage xml -o {toxworkdir}/coverage.xml --rcfile setup.cfg
36+ coverage html -d {toxworkdir}/htmlcov --rcfile setup.cfg
37+ diff-cover --compare-branch {env:DIFF_AGAINST:origin/master} {toxworkdir}/coverage.xml
38+ depends =
39+ py35,
40+ py36,
41+ py37,
42+ parallel_show_output = True
2043
2144[testenv:lint]
2245description = check the code style
@@ -26,19 +49,22 @@ commands = flake8 -j0 {posargs}
2649[testenv:type]
2750description = type check ourselves
2851basepython = python3.7
29- commands = python3 -m mypy --config-file mypy_self_check.ini -p mypy
52+ commands = python -m mypy --config-file mypy_self_check.ini -p mypy
3053
3154[testenv:docs]
3255description = invoke sphinx-build to build the HTML docs
3356basepython = python3.7
3457deps = -rdocs/requirements-docs.txt
35- commands = sphinx-build -d " {toxworkdir}/docs_doctree" docs/source " {toxworkdir}/docs_out" --color -W -bhtml {posargs}
58+ commands =
59+ sphinx-build -d " {toxworkdir}/docs_doctree" docs/source " {toxworkdir}/docs_out" --color -W -bhtml {posargs}
60+ python -c ' import pathlib; print("documentation available under file://\{ 0\} ".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
3661
3762[testenv:dev]
3863description = generate a DEV environment, that has all project libraries
3964usedevelop = True
40- basepython = python3.7
41- deps = -rtest-requirements.txt
42- -rdocs/requirements-docs.txt
43- commands = python -m pip list --format =columns
44- python -c ' import sys; print(sys.executable)'
65+ deps =
66+ -rtest-requirements.txt
67+ -rdocs/requirements-docs.txt
68+ commands =
69+ python -m pip list --format =columns
70+ python -c ' import sys; print(sys.executable)'
0 commit comments