-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtox.ini
243 lines (216 loc) · 6.07 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
# Generated from:
# https://github.com/plone/meta/tree/main/src/plone/meta/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
py313-plone62
py312-plone62
py311-plone62
py310-plone62
py313-plone61
py312-plone61
py311-plone61
py310-plone61
dependencies
##
# Add extra configuration options in .meta.toml:
# - to specify a custom testing combination of Plone and python versions, use `test_matrix`
# - to specify extra custom environments, use `envlist_lines`
# - to specify extra `tox` top-level options, use `config_lines`
# [tox]
# test_matrix = {"6.2" = ["3.13", "3.12"], "6.1" = ["3.10", "3.9"]}
# envlist_lines = """
# my_other_environment
# """
# config_lines = """
# my_extra_top_level_tox_configuration_lines
# """
##
[testenv:init]
description = Prepare environment
skip_install = true
allowlist_externals =
echo
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'
[test_runner]
deps = zope.testrunner
test =
zope-testrunner --all --test-path={toxinidir} -s plone.app.relationfield {posargs}
coverage =
coverage run --branch --source plone.app.relationfield {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir} -s plone.app.relationfield {posargs}
coverage report -m --format markdown
coverage xml
coverage html
[base]
description = shared configuration for tests and coverage
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 =
{[test_runner]deps}
plone62: -c https://dist.plone.org/release/6.2-dev/constraints.txt
plone61: -c https://dist.plone.org/release/6.1-dev/constraints.txt
plone60: -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"
##
extras =
test
##
# Add extra configuration options in .meta.toml:
# [tox]
# test_extras = """
# tests
# widgets
# """
#
# Add extra configuration options in .meta.toml:
# [tox]
# testenv_options = """
# basepython = /usr/bin/python3.8
# """
##
[testenv:test]
description = run the distribution tests
use_develop = {[base]use_develop}
skip_install = {[base]skip_install}
constrain_package_deps = {[base]constrain_package_deps}
set_env = {[base]set_env}
deps =
{[test_runner]deps}
-c https://dist.plone.org/release/6.2-dev/constraints.txt
commands = {[test_runner]test}
extras = {[base]extras}
[testenv]
description = run the distribution tests (generative environments)
use_develop = {[base]use_develop}
skip_install = {[base]skip_install}
constrain_package_deps = {[base]constrain_package_deps}
set_env = {[base]set_env}
deps = {[base]deps}
commands = {[test_runner]test}
extras = {[base]extras}
[testenv:coverage]
description = get a test coverage report
use_develop = {[base]use_develop}
skip_install = {[base]skip_install}
constrain_package_deps = {[base]constrain_package_deps}
set_env = {[base]set_env}
deps =
{[test_runner]deps}
coverage
-c https://dist.plone.org/release/6.2-dev/constraints.txt
commands = {[test_runner]coverage}
extras = {[base]extras}
[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.2-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.2-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
##
# Add extra configuration options in .meta.toml:
# [tox]
# extra_lines = """
# _your own configuration lines_
# """
##