-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
271 lines (183 loc) · 5.12 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
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
[tox]
isolated_build = True
envlist =
lint, mypy
coverage-py{38,39,310,311,py3}-tw{212,221,2310,trunk}
coverage-py312-tw2310-postgresql
coverage-py312-tw2310-mysql
coverage_combine
coverage_report
docs, docs-linkcheck
packaging
skip_missing_interpreters = {tty:True:False}
[default]
basepython = python3.11
deps =
tw212: Twisted==21.2.0
tw221: Twisted==22.1.0
tw2310: Twisted==23.10.0
twcurrent: Twisted
twtrunk: https://github.com/twisted/twisted/tarball/trunk#egg=Twisted
postgres: -r requirements/postgres.txt
mysql: -r requirements/mysql.txt
-r requirements/tox-pin-base.txt
{test,coverage}: -r requirements/tox-tests.txt
coverage: {[testenv:coverage_report]deps}
coverage: coverage_enable_subprocess
setenv =
PY_MODULE=dbxs
PYTHONPYCACHEPREFIX={envtmpdir}/pycache
##
# Default environment: unit tests
##
[testenv]
description = run tests
basepython =
.package: python3.11
py: python
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
py312: python3.12
pypy3: pypy3
pypy39: pypy3.9
deps = {[default]deps}
passenv = *
setenv =
{[default]setenv}
coverage: COVERAGE_PROCESS_START={toxinidir}/.coveragerc
TRIAL_ARGS={env:TRIAL_ARGS:--jobs=2}
commands =
# Run trial without coverage
test: python -b "{envdir}/bin/trial" --random=0 {env:TRIAL_ARGS} --temp-directory="{envlogdir}/trial.d" {posargs:{env:PY_MODULE}}
coverage: coverage run "{envdir}/bin/trial" --random=0 {env:TRIAL_ARGS} --temp-directory="{envlogdir}/trial.d" {posargs:{env:PY_MODULE}}
##
# Lint
##
[testenv:lint]
description = run all linters
basepython = {[default]basepython}
usedevelop = true
skip_install = True
deps =
-r requirements/pre-commit.txt
commands =
pre-commit run {posargs:--all-files}
##
# Mypy static type checking
##
[testenv:mypy]
description = run Mypy (static type checker)
basepython = {[default]basepython}
usedevelop = true
deps =
-r requirements/mypy.txt
{[default]deps}
commands =
mypy \
--cache-dir="{toxworkdir}/mypy_cache" \
{tty:--pretty:} \
{posargs:src}
##
# Coverage report
##
[testenv:coverage_combine]
commands = coverage combine
basepython={[default]basepython}
deps = coverage
depends =
coverage-py{37,38,39,310,311,py3}-tw{212,221,current,trunk}
[testenv:coverage_report]
description = generate coverage report
depends =
coverage-py{37,38,39,310,311,py3}-tw{1,2}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
coverage-py{37,38,39,310,311,py3}-tw{current,trunk}
coverage_combine
basepython = {[default]basepython}
skip_install = True
deps =
-r requirements/coverage.txt
setenv =
{[default]setenv}
commands =
- coverage xml
- coverage report --skip-covered
- coverage html
##
# Documentation
##
[testenv:docs]
description = build documentation
basepython = {[default]basepython}
deps =
-r requirements/sphinx.txt
commands =
sphinx-build \
-b html -d "{envtmpdir}/doctrees" \
"{toxinidir}/docs" \
"{toxinidir}/htmldocs"
[testenv:docs-auto]
description = build documentation and rebuild automatically
basepython = {[default]basepython}
deps =
{[testenv:docs]deps}
-r requirements/docs-auto.txt
commands =
sphinx-autobuild \
-b html -d "{envtmpdir}/doctrees" \
--host=localhost \
"{toxinidir}/docs" \
"{toxinidir}/htmldocs"
[testenv:apidocs]
basepython = {[testenv:docs]basepython}
deps =
pydoctor>=20.12.1
commands =
pydoctor \
--project-name=dbxs \
--project-url="https://github.com/glyph/dbxs/" \
--project-base-dir="{toxinidir}" \
--add-package="{toxinidir}/src/dbxs" \
--html-output="{toxinidir}/apidocs" \
--make-html
##
# Check for broken links in documentation
##
[testenv:docs-linkcheck]
description = check for broken links in documentation
basepython = {[testenv:docs]basepython}
deps =
{[testenv:docs]deps}
commands =
sphinx-build -b html -d "{envtmpdir}/doctrees" docs docs/_build/html
sphinx-build -b linkcheck docs docs/_build/html
##
# Packaging
##
[testenv:packaging]
description = check for potential packaging problems
depends =
coverage-py{37,38,39,310,311,py3}-tw{1,2}{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
coverage-py{37,38,39,310,311,py3}-tw{current,trunk}
basepython = {[default]basepython}
skip_install = True
deps =
-r requirements/packaging.txt
commands =
pip wheel --wheel-dir "{envtmpdir}/dist" --no-deps {toxinidir}
twine check "{envtmpdir}/dist/"*
##
# Print dependencies
##
[testenv:dependencies]
description = print dependencies
basepython = {[default]basepython}
recreate = true
deps =
pipdeptree
commands =
python -c 'print()'
pip freeze --exclude="{env:PY_MODULE}" --exclude=pipdeptree
python -c 'print()'
pipdeptree