-
Notifications
You must be signed in to change notification settings - Fork 6
/
tox.ini
147 lines (114 loc) · 3.84 KB
/
tox.ini
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
[tox]
minversion = 3.14
requires =
tox<4
envlist = py37-{test,runcmd}, py38-{test,runcmd}, py39-{test,runcmd}, py310-{test,runcmd}, py311-{test,runcmd}, run-{cmd,blackcheck,black,isort,isortcheck}, docs, coverage
[testenv:.tox]
envdir = {toxworkdir}/.tox
[testenv]
basepython =
py311: python3.11
py310,run,docs,coverage,clean,bootstrap: python3.10
py39: python3.9
py38: python3.8
py37: python3.7
envdir =
py311: {toxworkdir}/py311
py310,run,docs,coverage: {toxworkdir}/py310
py39: {toxworkdir}/py39
py38: {toxworkdir}/py38
py37: {toxworkdir}/py37
deps =
py37: packaging<22.0
py38: packaging>=22.0
py39: packaging>=22.0
py310: packaging>=22.0
usedevelop = true
extras=
dev
setenv =
PY_IGNORE_IMPORTMISMATCH = 1
passenv = HOME,CI,TRAVIS,TRAVIS_*,GITHUB_*,COVERALLS*,CODECOV*,SPELLCHECK,SSH_AUTH_SOCK,http_proxy,https_proxy,no_proxy
description =
py{37,38,39,310,311}-test: Run tests in the corresponding environment
py{37,38,39,310,311}-runcmd: Run arbitrary command following "--" in the corresponding environment
commands_pre =
python -V
commands =
py{37,38,39,310,311}-runcmd: {posargs:python -c 'print("No command")'}
py{37,38,39,310,311}-test: py.test -vvv --doctest-modules --cov=docs_versions_menu --durations=10 -x -s {posargs:src tests README.rst}
[testenv:docs]
description = Generate the docs
changedir = {toxinidir}/docs
commands =
sphinx-build . {posargs: _build/html --color}
[testenv:clean-docs]
description = Clean up files resulting from generating the docs
envdir = {toxworkdir}/clean
deps =
skip_install = True
commands_pre =
commands =
python docs/clean.py
[testenv:bootstrap]
description = Configure tox
envdir = {toxworkdir}/bootstrap
deps = tox
skip_install = True
commands_pre =
commands =
python scripts/bootstrap.py
[testenv:clean]
description = Clean up
envdir = {toxworkdir}/clean_
deps =
skip_install = True
commands_pre =
whitelist_externals = tox
commands =
python scripts/clean.py tests
python scripts/clean.py build
python docs/clean.py
[testenv:clean-tests]
description = Clean up files resulting from testing/coverage
envdir = {toxworkdir}/clean
deps =
skip_install = True
commands_pre =
commands =
python scripts/clean.py tests
[testenv:clean-build]
description = Clean up build artifacts (including __pycache__ folders)
envdir = {toxworkdir}/clean
deps =
skip_install = True
commands_pre =
commands =
python scripts/clean.py build
[testenv:coverage]
description = Generate a coverage report
depends = py38-test
commands =
coverage html
python -c 'import pathlib; print("coverage report available in \{\}".format(pathlib.Path(".") / "htmlcov" / "index.html"))'
[testenv:run-cmd]
description = Run arbitrary command following "--" in the current stable environment, e.g. "tox -e run-cmd -- ipython"
commands = {posargs:python -c 'print("No command")'}
[testenv:run-black]
description = Run black formatter in the current stable environment
commands = python -m black --skip-string-normalization --line-length 79 {posargs:src tests}
[testenv:run-blackcheck]
description = Run black formatter check in the latext venv
commands = python -m black --skip-string-normalization --line-length 79 --check --diff {posargs:src tests}
[testenv:run-isort]
description = Run isort formatter in the current stable environment
commands = python -m isort --recursive {posargs:src tests}
[testenv:run-isortcheck]
description = Run isort formatter check in the current stable environment
commands = python -m isort --recursive --check-only --diff {posargs:src tests}
[testenv:run-flake8]
description = Run flake8 formatter check in the current stable environment
commands = python -m flake8 {posargs:src tests}
[testenv:run-pylint]
description = Run pylint formatter check in the current stable environment
commands = python -m pylint -j 0 {posargs:src}