-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
tox.ini
220 lines (195 loc) · 5.1 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
# 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
##
# 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} -s plone.resource {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.resource {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir} -s plone.resource {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
##
# Add extra configuration options in .meta.toml:
# [tox]
# extra_lines = """
# _your own configuration lines_
# """
##