|
1 | 1 | [tox] |
2 | | -envlist = py27,py34,py35,py36,pypy,style,docs |
3 | | -minversion = 2.7.0 |
| 2 | +envlist = py27, |
| 3 | + py34, |
| 4 | + py35, |
| 5 | + py36, |
| 6 | + pypy, |
| 7 | + coverage, |
| 8 | + fix-lint, |
| 9 | + docs |
| 10 | +minversion = 2.9.0 |
| 11 | +skip_missing_interpreters = true |
4 | 12 |
|
5 | 13 | [testenv] |
6 | | -description = run the unit tests with pytest under the current Python env |
| 14 | +description = run the unit tests with pytest under {basepython} |
7 | 15 | setenv = COVERAGE_FILE={toxworkdir}/.coverage.{envname} |
8 | | -passenv = http_proxy https_proxy no_proxy SSL_CERT_FILE CI TRAVIS TRAVIS_* |
9 | | -deps = pytest >= 3.0.0 |
10 | | - pytest-cov |
11 | | - pytest-timeout |
12 | | - pytest-xdist |
13 | | -;NOTE --cov-config={toxinidir}/tox.ini is necessary until |
14 | | -;https://github.com/pytest-dev/pytest-cov/issues/168 is fixed |
15 | | -commands = pytest {posargs:tests} --cov-config="{toxinidir}/tox.ini" --cov="{envsitepackagesdir}/tox" --timeout=180 |
16 | | - |
17 | | -[testenv:dev] |
18 | | -description = DEV environment, if no posarg is specified: run pytest |
19 | | -# required to make looponfail reload on every source code change |
20 | | -usedevelop = True |
21 | | -commands = {posargs:py.test -s -x -f -v} |
| 16 | +passenv = http_proxy https_proxy no_proxy SSL_CERT_FILE TOXENV CI TRAVIS TRAVIS_* APPVEYOR APPVEYOR_* CODECOV_* |
| 17 | +extras = testing |
| 18 | +commands = pytest {posargs:--cov-config={toxinidir}/tox.ini --cov={envsitepackagesdir}/tox --timeout=180 tests} |
22 | 19 |
|
23 | 20 | [testenv:docs] |
24 | 21 | description = invoke sphinx-build to build the HTML docs, check that URIs are valid |
25 | 22 | basepython = python3.6 |
26 | | -deps = sphinx >= 1.6.3, < 2 |
27 | | - towncrier >= 17.8.0 |
28 | | - {[testenv]deps} |
29 | | -commands = sphinx-build -d "{toxworkdir}/docs_doctree" doc "{toxworkdir}/docs_out" --color -W -bhtml |
30 | | - sphinx-build -d "{toxworkdir}/docs_doctree" doc "{toxworkdir}/docs_out" --color -W -blinkcheck |
| 23 | +extras = docs |
| 24 | +commands = sphinx-build -d {toxworkdir}/docs_doctree doc {toxworkdir}/docs_out --color -W -bhtml |
| 25 | + sphinx-build -d {toxworkdir}/docs_doctree doc {toxworkdir}/docs_out --color -W -blinkcheck |
31 | 26 |
|
32 | 27 | [testenv:fix-lint] |
33 | 28 | basepython = python3.6 |
34 | 29 | passenv = {[testenv]passenv} |
35 | 30 | HOMEPATH |
36 | | -deps = flake8 == 3.4.1 |
37 | | - flake8-bugbear == 17.4.0 |
38 | | - pre-commit == 1.3.0 |
| 31 | +extras = lint |
39 | 32 | description = run static analysis and style check using flake8 |
40 | 33 | commands = python -m flake8 --show-source tox setup.py {posargs} |
41 | 34 | python -m flake8 --show-source doc tests {posargs} |
42 | 35 | pre-commit run --all-files |
43 | | - echo "hint: run {envdir}/bin/pre-commit install" to add checks as pre-commit hook |
| 36 | + python -c 'print("hint: run {envdir}/bin/pre-commit install to add checks as pre-commit hook")' |
44 | 37 |
|
45 | | -[flake8] |
46 | | -max-complexity = 22 |
47 | | -max-line-length = 99 |
48 | | - |
49 | | -[testenv:X] |
50 | | -description = print the positional arguments passed in with echo |
51 | | -commands = echo {posargs} |
52 | 38 |
|
53 | 39 | [testenv:coverage] |
54 | | -description = [run locally after tests]: combine coverage data and create reports |
55 | | -skip_install = True |
56 | | -setenv = COVERAGE_FILE={toxworkdir}/.coverage |
| 40 | +description = combine coverage data and create reports |
57 | 41 | deps = coverage |
| 42 | +skip_install = True |
| 43 | +changedir = {toxworkdir} |
| 44 | +setenv = COVERAGE_FILE=.coverage |
58 | 45 | commands = coverage erase |
59 | 46 | coverage combine |
| 47 | + coverage report --rcfile={toxinidir}/tox.ini |
60 | 48 | coverage xml |
61 | | - coverage html |
62 | 49 |
|
63 | 50 | [testenv:codecov] |
64 | | -description = [only run on CI]: upload coverage data to codecov |
65 | | -;NOTE token should not be necesssary but seems to be on appveyor |
66 | | -setenv = {[testenv:coverage]setenv} |
67 | | - CODECOV_TOKEN = 01eb408d-0640-4527-a5f6-9dfe30f9f2ba |
| 51 | +description = [only run on CI]: upload coverage data to codecov (depends on coverage running first) |
68 | 52 | deps = codecov |
69 | | -commands = codecov --required |
| 53 | +skip_install = True |
| 54 | +commands = codecov --file {toxworkdir}/coverage.xml |
70 | 55 |
|
71 | 56 | [testenv:pra] |
72 | 57 | passenv = * |
73 | 58 | description = "personal release assistant" - see HOWTORELEASE.rst |
74 | | -skip_install = True |
75 | | -deps = devpi |
76 | | - towncrier |
77 | | - twine |
78 | | -commands = "{toxinidir}/tasks/pra.sh" {posargs} |
| 59 | +extras = publish, docs |
| 60 | +commands = {toxinidir}/tasks/pra.sh {posargs} |
| 61 | + |
| 62 | +[testenv:X] |
| 63 | +description = print the positional arguments passed in with echo |
| 64 | +commands = echo {posargs} |
| 65 | + |
| 66 | +[testenv:dev] |
| 67 | +description = generate a DEV environment |
| 68 | +extras = testing, docs, lint |
| 69 | +# required to make looponfail reload on every source code change |
| 70 | +usedevelop = True |
| 71 | +commands = python -m pip list --format=columns |
| 72 | + python -c 'import sys; print(sys.executable)' |
| 73 | + |
| 74 | +[flake8] |
| 75 | +max-complexity = 22 |
| 76 | +max-line-length = 99 |
79 | 77 |
|
80 | 78 | [coverage:run] |
81 | | -branch = True |
82 | | -source = tox |
83 | 79 | omit = tox/__main__.py |
84 | 80 |
|
| 81 | +[coverage:report] |
| 82 | +skip_covered = True |
| 83 | +show_missing = True |
| 84 | +exclude_lines = if __name__ == ["']__main__["']: |
| 85 | +
|
85 | 86 | [coverage:paths] |
86 | 87 | source = tox |
87 | 88 | {toxworkdir}/*/lib/python*/site-packages/tox |
| 89 | + {toxworkdir}/*/Lib/site-packages/tox |
88 | 90 | {toxworkdir}/pypy*/site-packages/tox |
89 | 91 |
|
90 | | -[coverage:report] |
91 | | -exclude_lines = if __name__ == ["']__main__["']: |
92 | | -
|
93 | 92 | [pytest] |
94 | 93 | addopts = -rsxX |
95 | 94 | rsyncdirs = tests tox |
|
0 commit comments