-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
344 lines (267 loc) · 5.92 KB
/
tox.ini
File metadata and controls
344 lines (267 loc) · 5.92 KB
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
[tox]
envlist = py3{9,10,11,12,13}-{linux,macos,windows},coverage
skip_missing_interpreters = true
isolated_build = true
skipsdist = true
[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313
[gh-actions:env]
PLATFORM =
ubuntu-latest: linux
macos-latest: macos
windows-latest: windows
ubuntu-22.04: linux
macos-13: macos
windows-2019: windows
[base]
deps =
pip>=23.1
setuptools_scm[toml]
[build]
deps =
pip>=23.1
build
twine
[reqs]
deps =
doorstop
[testenv]
description =
Default test environment for pytest and Python version/gh-action test matrix
passenv =
DISPLAY
XAUTHORITY
HOME
USERNAME
USER
XDG_*
CI
OS
PLATFORM
PYTHON
PYTHONIOENCODING
PIP_DOWNLOAD_CACHE
pythonLocation
setenv =
COVERAGE_FILE = .coverage.{envname}
allowlist_externals =
bash
deps =
{[base]deps}
-e .[test,cov]
commands =
python -m pytest -v tests/ --capture={posargs:"fd"} --cov=simple --cov-branch --cov-report term-missing
[testenv:coverage]
description =
Follow-on multi-platform test coverage (depends on default env)
basepython =
python3
skip_install =
true
allowlist_externals =
bash
deps =
coverage
commands =
bash -c 'coverage combine .coverage.py*'
coverage xml
depends =
py39
py310
py311
py312
py313
[coverage:run]
parallel=True
[testenv:{dev,node}]
# these tox env cmds share a virtual env using the following plugin
# https://github.com/masenf/tox-ignore-env-name-mismatch
envdir = {toxinidir}/.venv
runner = ignore_env_name_mismatch
skip_install = true
description =
Dev environment with doorstop using pip editable (-e) install (shared with node)
setenv =
PIP_PRE = {env:PIP_PRE:1}
passenv =
pythonLocation
CI
PYTHONIOENCODING
PIP_DOWNLOAD_CACHE
SSH*
deps =
node: nodeenv
{[base]deps}
{[reqs]deps}
-e .
commands_pre =
node: nodeenv --prebuilt -p
node: npm install -g @mermaid-js/mermaid-cli
commands =
dev: doorstop {posargs}
node: mmdc {posargs:"-h"}
[testenv:lint]
description =
Linting environment using Pylint with normal pip install
deps =
{[base]deps}
-r requirements.txt
pylint
commands =
pylint -d C0104 --fail-under=9 src/
[testenv:style]
description =
Python coding style using flake8
passenv =
CI
PYTHONIOENCODING
deps =
{[base]deps}
flake8
commands =
flake8 src/
[testenv:build]
skip_install = true
description =
PEP517 package build and metadata check
passenv =
pythonLocation
CI
PYTHONIOENCODING
PIP_DOWNLOAD_CACHE
SETUPTOOLS_SCM_PRETEND_VERSION
deps =
{[build]deps}
commands =
python -m build .
twine check dist/*
[testenv:check]
skip_install = true
always_copy = False
description =
Install check for built wheel package (clean venv with no extra deps)
passenv =
CI
GITHUB*
PIP_DOWNLOAD_CACHE
deps =
pip>=23.1
commands =
python -m pip install simple --pre --force-reinstall --prefer-binary -f dist/
python -m pip show -f simple
[testenv:{docs,ldocs,cdocs}]
# these tox env cmds share a virtual env using the following plugin
# https://github.com/masenf/tox-ignore-env-name-mismatch
envdir = {toxworkdir}/docs
runner = ignore_env_name_mismatch
skip_install = true
description =
docs: (re)Build Sphinx documentation
ldocs: Run linkcheck on Sphinx documentation
cdocs: Clean Sphinx html build artifacts
allowlist_externals =
make
bash
deps =
{[base]deps}
{[reqs]deps}
.[doc]
commands_pre =
docs: doorstop publish REQ docs/source/ds/reqs_tree.md
docs: doorstop publish TST docs/source/ds/unit_tests.md
docs: doorstop publish SDD docs/source/ds/sw_design.md
docs: bash docs/sphinx_prep.sh docs/source/ds/reqs_tree.md
docs: bash docs/sphinx_prep.sh docs/source/ds/unit_tests.md
docs: bash docs/sphinx_prep.sh docs/source/ds/sw_design.md
commands =
docs: make -C docs html
ldocs: make -C docs linkcheck
cdocs: make -C docs clean
[testenv:mypy]
skip_install = true
description =
Run mypy type checker (needs all deps)
deps =
{[base]deps}
mypy
-r requirements.txt
munch-stubs @ git+https://github.com/VCTLabs/munch-stubs.git@main
commands =
python -m mypy --follow-imports=normal --install-types --check-untyped-defs --non-interactive src/
[testenv:reuse]
skip_install = true
description =
Run reuse lint license checks, install sbom tool
passenv =
PYTHON
CI
OS
PYTHONIOENCODING
PIP_DOWNLOAD_CACHE
deps =
{[base]deps}
reuse
sbom4python
commands =
reuse {posargs:"lint"}
[testenv:sec]
skip_install = true
description =
Run Bandit security checks
passenv =
PYTHON
CI
OS
PYTHONIOENCODING
PIP_DOWNLOAD_CACHE
deps =
{[base]deps}
bandit[toml]
commands =
bandit -c pyproject.toml -r src
[testenv:md]
skip_install = true
passenv =
DEBUG
PYTHON
CI
OS
PYTHONIOENCODING
PIP_DOWNLOAD_CACHE
deps =
{[base]deps}
commands =
python docs/process_md_urls.py {posargs}
[testenv:changes]
skip_install = true
description =
Generate full or partial changelog; use git delta syntax for changes-since
passenv =
CI
OS
PIP_DOWNLOAD_CACHE
setenv =
VERSION = {env:VERSION}
allowlist_externals = bash
deps =
{[base]deps}
gitchangelog @ https://github.com/sarnold/gitchangelog/releases/download/3.2.0/gitchangelog-3.2.0-py3-none-any.whl
commands =
bash -c 'gitchangelog {posargs} > CHANGELOG.rst'
[testenv:clean]
skip_install = true
allowlist_externals =
bash
description =
Clean build artifacts and workflow cruft (does not clean Tox env dirs)
deps =
pip>=21.1
commands =
bash -c 'rm -rf src/*.egg_info dist/ build/ .coverage* coverage.xml'
bash -c 'rm -rf .pytest_cache __pycache__ src/*/__pycache__ docs/source/api'
bash -c 'rm -rf docs/source/ds/*.md docs/source/ds/*/*.svg'