summaryrefslogtreecommitdiff
path: root/tox.ini
blob: 46a892b816aaf284a73401b6f59b9f7ab0c90aef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
[tox]
envlist = py27,
          py34,
          py35,
          py36,
          pypy,
          coverage,
          fix-lint,
          docs
minversion = 2.9.0
skip_missing_interpreters = true

[testenv]
description = run the 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 and check that all links are valid
whitelist_externals = sphinx-build
basepython = python3.6
extras = docs
commands = sphinx-build -d "{toxworkdir}/docs_doctree" doc "{toxworkdir}/docs_out" --color -W -bhtml


[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 = 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]
platform = linux
passenv = *
description = "personal release assistant" - see HOWTORELEASE.rst
extras = publish, docs
commands = sphinx-build -d "{toxworkdir}/docs_doctree" doc "{toxworkdir}/docs_out" --color -W -blinkcheck
           "{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
ignore = E203, W503

[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 -vvv --showlocals
rsyncdirs = tests tox
looponfailroots = tox tests
norecursedirs = .hg .tox
xfail_strict = True

[isort]
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
line_length = 99
known_first_party = tox
known_third_party = pkg_resources,pluggy,py,pytest,setuptools,six