-
Notifications
You must be signed in to change notification settings - Fork 96
/
tox.ini
157 lines (147 loc) · 3.83 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
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
[tox]
minversion = 3.18
envlist =
release-check
lint
py38
py39
py310
py311
py312
py313
docs
coverage
pre-commit
[testenv]
skip_install = true
deps =
setuptools < 69
zc.buildout >= 3.0.1
wheel > 0.37
cffi >= 1.17.0rc1
# The universal2 environment is for Python on macOS built with
# universal2 mode instead of architecture-specific. These dependencies
# must be installed separately, zc.buildout is incompatible with the
# universal2 mode and cannot install them itself.
universal2: -c {toxinidir}/constraints.txt
universal2: zope.interface
universal2: zope.security
universal2: zope.container
universal2: Persistence
universal2: Acquisition
universal2: AccessControl
universal2: zodbpickle
universal2: charset_normalizer
universal2: MarkupSafe
universal2: zope.testrunner
setenv =
py312: VIRTUALENV_PIP=23.1.2
py312: PIP_REQUIRE_VIRTUALENV=0
commands_pre =
{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} buildout:root-directory={toxinidir}
commands =
# The universal2 environment only runs Zope's own tests
universal2: {envdir}/bin/test {posargs:-vc}
# All other environments run the expanded alltests script
# the `layer` argument below suppresses a `ZCatalog` performance test
# which occasionally fails on GITHUB
!universal2: {envdir}/bin/alltests --layer '!Products.PluginIndexes' {posargs:-vc}
allowlist_externals = *
[testenv:pre-commit]
basepython = python3
description = This env runs all linters configured in .pre-commit-config.yaml
skip_install = true
deps =
pre-commit
commands_pre =
commands =
pre-commit run --all-files --show-diff-on-failure
[testenv:autopep8]
basepython = python3.8
skip_install = true
deps =
-cconstraints.txt
autopep8
docformatter
commands =
autopep8 --verbose --in-place --recursive --aggressive --aggressive {toxinidir}/src setup.py
docformatter --in-place --recursive {toxinidir}/src setup.py
[testenv:release-check]
description = ensure that the distribution is ready to release
basepython = python3
skip_install = true
deps =
twine
build
check-manifest
check-python-versions >= 0.20.0
wheel
commands_pre =
commands =
check-manifest
check-python-versions --only setup.py,tox.ini,.github/workflows/tests.yml
python -m build --sdist --no-isolation
twine check dist/*
[testenv:lint]
basepython = python3
commands_pre =
mkdir -p {toxinidir}/parts/flake8
allowlist_externals =
mkdir
commands =
isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py
flake8 {toxinidir}/src {toxinidir}/setup.py
deps =
flake8
isort
# Useful flake8 plugins that are Python and Plone specific:
flake8-coding
flake8-debugger
mccabe
[testenv:isort-apply]
basepython = python3
commands_pre =
deps =
isort
commands =
isort {toxinidir}/src {toxinidir}/setup.py []
[testenv:docs]
basepython = python3
skip_install = false
extras =
docs
commands_pre =
commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
[testenv:coverage]
basepython = python3
skip_install = true
allowlist_externals =
{[testenv]allowlist_externals}
mkdir
deps =
{[testenv]deps}
coverage
commands =
mkdir -p {toxinidir}/parts/htmlcov
coverage run {envdir}/bin/alltests {posargs:-vc}
coverage html
coverage report -m --fail-under=80
[coverage:run]
branch = True
source = src
[coverage:report]
precision = 2
ignore_errors = True
exclude_lines =
pragma: no cover
pragma: nocover
except ImportError:
raise NotImplementedError
if __name__ == '__main__':
self.fail
raise AssertionError
[coverage:html]
directory = parts/htmlcov