-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
tox.ini
330 lines (291 loc) · 7.34 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
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
# Generated from:
# https://github.com/plone/meta/tree/main/config/default
# See the inline comments on how to expand/tweak this configuration file
[tox]
# We need 4.4.0 for constrain_package_deps.
min_version = 4.4.0
envlist =
lint
test
dependencies
py{38,39,310,311}-plone{60}
linkcheck
plone6docs
docs
skip_missing_interpreters = True
[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
[gh-actions:env]
PLONE =
60: plone60
##
# Add extra configuration options in .meta.toml:
# [tox]
# envlist_lines = """
# my_other_environment
# """
# config_lines = """
# my_extra_top_level_tox_configuration_lines
# """
##
[testenv]
skip_install = true
allowlist_externals =
echo
false
# Make sure typos like `tox -e formaat` are caught instead of silently doing nothing.
# See https://github.com/tox-dev/tox/issues/2858.
commands =
echo "Unrecognized environment name {envname}"
false
##
# Add extra configuration options in .meta.toml:
# [tox]
# testenv_options = """
# basepython = /usr/bin/python3.8
# """
##
[testenv:init]
description = Prepare environment
skip_install = true
commands =
echo "Initial setup complete"
[testenv:format]
description = automatically reformat code
skip_install = true
deps =
pre-commit
commands =
pre-commit run -a pyupgrade
pre-commit run -a isort
pre-commit run -a black
pre-commit run -a zpretty
[testenv:lint]
description = run linters that will help improve the code style
skip_install = true
deps =
pre-commit
commands =
pre-commit run -a
[testenv:dependencies]
description = check if the package defines all its dependencies
skip_install = true
deps =
build
z3c.dependencychecker==2.14.3
commands =
python -m build --sdist
dependencychecker
[testenv:dependencies-graph]
description = generate a graph out of the dependencies of the package
skip_install = false
allowlist_externals =
sh
deps =
pipdeptree==2.5.1
graphviz # optional dependency of pipdeptree
commands =
sh -c 'pipdeptree --exclude setuptools,wheel,pipdeptree,zope.interface,zope.component --graph-output svg > dependencies.svg'
[testenv:test]
description = run the distribution tests
use_develop = true
skip_install = false
constrain_package_deps = true
set_env =
ROBOT_BROWSER=headlesschrome
##
# Specify extra test environment variables in .meta.toml:
# [tox]
# test_environment_variables = """
# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/
# """
#
# Set constrain_package_deps .meta.toml:
# [tox]
# constrain_package_deps = "false"
##
deps =
zope.testrunner
-c https://dist.plone.org/release/6.0-dev/constraints.txt
##
# Specify additional deps in .meta.toml:
# [tox]
# test_deps_additional = "-esources/plonegovbr.portal_base[test]"
#
# Specify a custom constraints file in .meta.toml:
# [tox]
# constraints_file = "https://my-server.com/constraints.txt"
##
commands =
zope-testrunner --all --test-path={toxinidir}/src -s plone.api {posargs}
extras =
test
##
# Add extra configuration options in .meta.toml:
# [tox]
# test_extras = """
# tests
# widgets
# """
##
[testenv:coverage]
description = get a test coverage report
use_develop = true
skip_install = false
constrain_package_deps = true
set_env =
ROBOT_BROWSER=headlesschrome
##
# Specify extra test environment variables in .meta.toml:
# [tox]
# test_environment_variables = """
# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/
# """
##
deps =
coverage
zope.testrunner
-c https://dist.plone.org/release/6.0-dev/constraints.txt
commands =
coverage run --branch --source plone.api {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir}/src -s plone.api {posargs}
coverage report -m --format markdown
coverage xml
coverage html
extras =
test
[testenv:release-check]
description = ensure that the distribution is ready to release
skip_install = true
deps =
twine
build
towncrier
-c https://dist.plone.org/release/6.0-dev/constraints.txt
commands =
# fake version to not have to install the package
# we build the change log as news entries might break
# the README that is displayed on PyPI
towncrier build --version=100.0.0 --yes
python -m build --sdist
twine check dist/*
[testenv:circular]
description = ensure there are no cyclic dependencies
use_develop = true
skip_install = false
# Here we must always constrain the package deps to what is already installed,
# otherwise we simply get the latest from PyPI, which may not work.
constrain_package_deps = true
set_env =
##
# Specify extra test environment variables in .meta.toml:
# [tox]
# test_environment_variables = """
# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/
# """
##
allowlist_externals =
sh
deps =
pipdeptree
pipforester
-c https://dist.plone.org/release/6.0-dev/constraints.txt
commands =
# Generate the full dependency tree
sh -c 'pipdeptree -j > forest.json'
# Generate a DOT graph with the circular dependencies, if any
pipforester -i forest.json -o forest.dot --cycles
# Report if there are any circular dependencies, i.e. error if there are any
pipforester -i forest.json --check-cycles -o /dev/null
[testenv:py{38,39,310,311}-plone{60}]
skip_install = True
commands =
python -VV
pip install -r requirements.txt
pip list
{envbindir}/buildout -c /{toxinidir}/{env:BUILDOUT_FILE} buildout:directory={envdir} buildout:develop={toxinidir} install test
{envbindir}/buildout -c {toxinidir}/{env:BUILDOUT_FILE} buildout:directory={envdir} buildout:develop={toxinidir} annotate
{envbindir}/test
setenv =
BUILDOUT_FILE=test_plone-60.cfg
deps =
pdbpp
manuel
# tox < 4.0.0
whitelist_externals =
mkdir
echo
# tox >= 4.0.0
allowlist_externals =
mkdir
echo
[testenv:plone6docs]
# New docs with sphinx-book-theme
# See [testenv:docs] for classic documentation
basepython = python3.11
skip_install = False
package = editable
allowlist_externals =
mkdir
extras =
tests
deps =
-r requirements-docs.txt
commands =
python -VV
mkdir -p {toxinidir}/_build/plone6docs
sphinx-build -b html -d _build/plone6docs/doctrees docs _build/plone6docs/html
[testenv:docs]
basepython = python3.9
skip_install = False
usedevelop = True
allowlist_externals =
mkdir
extras =
tests
deps =
-r requirements-docs.txt
commands =
python -VV
mkdir -p {toxinidir}/_build/docs
sphinx-build -b html -D html_theme=alabaster -d _build/docs/doctrees docs _build/docs/html
whitelist_externals =
mkdir
[testenv:linkcheck]
basepython = python3.11
skip_install = False
package = editable
allowlist_externals =
mkdir
extras =
{[testenv:plone6docs]extras}
deps =
{[testenv:plone6docs]deps}
commands =
python -VV
mkdir -p {toxinidir}/_build/plone6docs
sphinx-build -b linkcheck -d _build/plone6docs/doctrees docs _build/plone6docs/linkcheck
[testenv:livehtml]
basepython = python3.11
skip_install = False
package = editable
allowlist_externals =
mkdir
extras =
{[testenv:plone6docs]extras}
deps =
{[testenv:plone6docs]deps}
commands =
python -VV
mkdir -p {toxinidir}/_build/plone6docs
sphinx-autobuild -b html -d _build/plone6docs/doctrees docs _build/plone6docs/html
##
# Add extra configuration options in .meta.toml:
# [tox]
# extra_lines = """
# _your own configuration lines_
# """
##