-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtox.ini
208 lines (186 loc) · 4.62 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
[tox]
minversion = 3.18
envlist = codestyle,docstyle,pylint,flake,types,test,coverage
isolated_build = True
[testenv]
install_command = pip install -i {env:PIP_INDEX_URL:https://pypi.org/simple} {opts} {packages}
extras = test
commands =
test-py3{8,9,10,11,12}: pytest {posargs:tests}
test-py3{8,9,10,11,12}-{jit,msgpack}: pytest {posargs:tests}
[testenv:format]
description = Autoformat code.
skip_install = true
envdir = {toxworkdir}/lint
deps =
black
isort >= 5.0
commands =
isort {posargs:src/ tests/}
black {posargs:src/ tests/}
[testenv:format-check]
description = Check code style using black.
skip_install = true
envdir = {toxworkdir}/lint
deps =
black
commands =
black --check {posargs:src/ tests/}
[testenv:lint]
description = Check code for stylistic and logical errors.
envdir = {toxworkdir}/lint
deps =
{[testenv:codestyle]deps}
{[testenv:docstyle]deps}
{[testenv:types]deps}
{[testenv:errors]deps}
commands =
{[testenv:codestyle]commands}
{[testenv:docstyle]commands}
{[testenv:types]commands}
{[testenv:errors]commands}
[testenv:codestyle]
description = Check code and tests for PEP 8 compliance and code complexity.
skip_install = true
envdir = {toxworkdir}/lint
deps =
flake8
flake8-colors
isort >= 5.0
commands =
flake8 --select E,W,C --show-source {posargs:src/ tests/}
isort --check --diff {posargs:src/ tests/}
[testenv:docstyle]
description = Check docstrings for PEP 257 compliance (Google style).
skip_install = true
envdir = {toxworkdir}/lint
deps =
pydocstyle
commands = pydocstyle {posargs:src/}
[testenv:flake]
description = Find errors with static code analysis.
envdir = {toxworkdir}/lint
deps =
flake8
commands =
flake8 --select F {posargs:src/ tests/}
[testenv:pylint]
description = Find errors with static code analysis.
envdir = {toxworkdir}/lint
deps =
pylint
commands =
pylint --output-format=colorized --errors-only {posargs:src/RsWaveform}
[testenv:errors]
description = Find errors with static code analysis.
envdir = {toxworkdir}/lint
deps =
{[testenv:flake]deps}
{[testenv:pylint]deps}
commands =
{[testenv:flake]commands}
{[testenv:pylint]commands}
[testenv:types]
description = Run static type checker.
envdir = {toxworkdir}/lint
deps =
mypy
numpy
numba
indexedproperty
commands =
mypy --check-untyped-defs --install-types --non-interactive {posargs:src/ tests/}
[testenv:test]
description = Run tests with pytest.
passenv = CI
setenv =
COVERAGE_FILE = .coverage.{env:OS:linux}
extras = test
commands =
pytest --cov --cov-report= {posargs:tests}
[testenv:test-msgpack]
description = Run tests with pytest and msgpack installed.
passenv = CI
setenv =
COVERAGE_FILE = .coverage.msgpack.{env:OS:linux}
extras =
{[testenv:test]extras}
msgpack
commands =
{[testenv:test]commands}
[testenv:test-jit]
description = Run tests with pytest.
passenv = CI
setenv =
COVERAGE_FILE = .coverage.jit.{env:OS:linux}
extras =
{[testenv:test]extras}
jit
commands =
{[testenv:test]commands}
[testenv:test-all]
description = Find errors with static code analysis.
envdir = {toxworkdir}/lint
deps =
{[testenv:test]deps}
{[testenv:test-jit]deps}
{[testenv:test-msgpack]deps}
commands =
{[testenv:test]commands}
{[testenv:test-jit]commands}
{[testenv:test-msgpack]commands}
[testenv:coverage]
description = Measure, combine and report coverage.
envdir = {toxworkdir}/test
extras = test
deps =
coverage[toml] >= 6.0
commands =
coverage combine
coverage report
coverage xml
coverage html --fail-under 50
[testenv:clean]
description = Remove all generated and temporary files.
skip_install = true
allowlist_externals =
git
deps =
coverage[toml]
commands =
coverage erase
git clean -xfd --exclude .tox/**/clean
[testenv:docs]
description = Generate API documentation.
changedir = docs
extras = docs
commands =
sphinx-build -W -d {envtmpdir}/doctrees . {envtmpdir}/html
[testenv:version]
description = Increment version number.
skip_install = true
deps = bump2version
commands = bumpversion --verbose --tag --commit {posargs}
[testenv:build]
description = Build package.
allowlist_externals =
git
deps =
build[virtualenv]
commands =
git clean -xfd dist/
python -m build
[testenv:upload]
description = Upload package
deps = twine
passenv =
TWINE_USERNAME
TWINE_PASSWORD
REPOSITORY_URL
commands = twine upload dist/*
[flake8]
ignore = W503,E203
max-line-length = 88
format = ${cyan}%(path)s${reset}:${yellow_bold}%(row)d${reset}:${green_bold}%(col)d${reset}: ${red_bold}%(code)s${reset} %(text)s
[pydocstyle]
convention = google