[tox] minversion = 3.3.0 envlist = embed, py{27,34,35,36,37}, pypy{,3}, cross_python{2,3}, docs, package_readme isolated_build = true skip_missing_interpreters = true [testenv] description = run tests with {basepython} setenv = PIP_DISABLE_VERSION_CHECK = 1 COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}} deps = mock pytest >= 3.0.0, <4 pytest-cov >= 2.5.1, <3 pytest-mock >= 1.10.0, <2 pytest-timeout >= 1.3.0, <2 commands = pytest {posargs:\ --cov=virtualenv \ --cov-config="{toxinidir}/tox.ini" \ --timeout=180 \ --junitxml={env:JUNIT_XML_FILE:{toxworkdir}/.test.{envname}.xml} \ . } [testenv:.package] deps = [coverage:run] branch = false [coverage:report] skip_covered = True show_missing = True [coverage:paths] source = src .tox/*/lib/python*/site-packages .tox/pypy*/site-packages .tox\*\Lib\site-packages */virtualenv.py *\virtualenv.py [testenv:coverage] description = [run locally after tests]: combine coverage data and create report; generates a diff coverage against origin/master (can be changed by setting DIFF_AGAINST env var) deps = {[testenv]deps} coverage >= 4.4.1, < 5 diff_cover skip_install = True passenv = DIFF_AGAINST setenv = COVERAGE_FILE={toxworkdir}/.coverage commands = coverage erase coverage combine coverage report -m coverage xml -o {toxworkdir}/coverage.xml coverage html -d {toxworkdir}/htmlcov diff-cover --compare-branch {env:DIFF_AGAINST:origin/master} {toxworkdir}/coverage.xml [testenv:cross_python2] description = test creating a python3 venv with a python2-based virtualenv basepython = python2 deps = commands = virtualenv -p python3 {envtmpdir}/{envname} {envtmpdir}/{envname}/bin/python -V 2>&1 | grep "Python 3" [testenv:cross_python3] description = test creating a python2 venv with a python3-based virtualenv basepython = python3 deps = commands = virtualenv -p python2 {envtmpdir}/{envname} {envtmpdir}/{envname}/bin/python -V 2>&1 | grep "Python 2" [testenv:docs] basepython = python3 description = build documentation deps = sphinx commands = sphinx-build -d "{envtmpdir}/doctree" docs "{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:package_readme] description = check that the long description is valid (need for PyPi) deps = twine >= 1.12.1 pip >= 18.0.0 skip_install = true extras = commands = pip wheel -w {envtmpdir}/build --no-deps . twine check {envtmpdir}/build/* [testenv:embed] description = embed dependencies into virtualenv.py skip_install = true deps = commands = python {toxinidir}/bin/rebuild-script.py