[tox] envlist = py27, py34, py35, py36, pypy, coverage, fix-lint, docs minversion = 2.9.0 skip_missing_interpreters = true [testenv] description = run the unit tests with pytest under {basepython} setenv = COVERAGE_FILE={toxworkdir}/.coverage.{envname} passenv = http_proxy https_proxy no_proxy SSL_CERT_FILE TOXENV CI TRAVIS TRAVIS_* APPVEYOR APPVEYOR_* CODECOV_* extras = testing commands = pytest {posargs:--cov-config="{toxinidir}/tox.ini" --cov="{envsitepackagesdir}/tox" --timeout=180 tests} [testenv:docs] description = invoke sphinx-build to build the HTML docs, check that URIs are valid basepython = python3.6 extras = docs commands = sphinx-build -d "{toxworkdir}/docs_doctree" doc "{toxworkdir}/docs_out" --color -W -bhtml sphinx-build -d "{toxworkdir}/docs_doctree" doc "{toxworkdir}/docs_out" --color -W -blinkcheck [testenv:fix-lint] basepython = python3.6 passenv = {[testenv]passenv} HOMEPATH # without PROGRAMDATA cloning using git for Windows will fail with an # `error setting certificate verify locations` error PROGRAMDATA extras = lint description = run static analysis and style check using flake8 commands = python -m flake8 --show-source tox setup.py {posargs} python -m flake8 --show-source doc tests {posargs} pre-commit run --all-files --show-diff-on-failure python -c 'print("hint: run {envdir}/bin/pre-commit install to add checks as pre-commit hook")' [testenv:coverage] description = combine coverage data and create reports deps = coverage skip_install = True changedir = {toxworkdir} setenv = COVERAGE_FILE=.coverage commands = coverage erase coverage combine coverage report --rcfile="{toxinidir}/tox.ini" coverage xml [testenv:codecov] description = [only run on CI]: upload coverage data to codecov (depends on coverage running first) deps = codecov skip_install = True commands = codecov --file "{toxworkdir}/coverage.xml" [testenv:exit_code] # to see how the InvocationError is displayed, use # PYTHONPATH=.:$PYTHONPATH python3 -m tox -e exit_code basepython = python3.6 description = commands with several exit codes skip_install = True commands = python3.6 -c "import sys; sys.exit(139)" [testenv:pra] passenv = * description = "personal release assistant" - see HOWTORELEASE.rst extras = publish, docs commands = "{toxinidir}/tasks/pra.sh" {posargs} [testenv:X] description = print the positional arguments passed in with echo commands = echo {posargs} [testenv:dev] description = generate a DEV environment extras = testing, docs # required to make looponfail reload on every source code change usedevelop = True basepython = python3.6 commands = python -m pip list --format=columns python -c 'import sys; print(sys.executable)' [flake8] max-complexity = 22 max-line-length = 99 [coverage:run] omit = tox/__main__.py [coverage:report] skip_covered = True show_missing = True exclude_lines = if __name__ == ["']__main__["']: [coverage:paths] source = tox {toxworkdir}/*/lib/python*/site-packages/tox {toxworkdir}/*/Lib/site-packages/tox {toxworkdir}/pypy*/site-packages/tox [pytest] addopts = -rsxX rsyncdirs = tests tox looponfailroots = tox tests norecursedirs = .hg .tox xfail_strict = True