-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
156 lines (141 loc) · 3.8 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
# Generated from:
# https://github.com/plone/meta/tree/master/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
[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.11
commands =
python -m build --sdist --no-isolation
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
deps =
pytest-plone
pytest
-c https://dist.plone.org/release/6.0-dev/constraints.txt
##
# Specify a custom constraints file in .meta.toml:
# [tox]
# constraints_file = "https://my-server.com/constraints.txt"
##
commands =
pytest --disable-warnings {posargs} {toxinidir}/tests
extras =
test
[testenv:coverage]
description = get a test coverage report
use_develop = true
skip_install = false
constrain_package_deps = true
set_env = ROBOT_BROWSER=headlesschrome
deps =
pytest-plone
pytest
coverage
-c https://dist.plone.org/release/6.0-dev/constraints.txt
commands =
coverage run --source collective.person -m pytest {posargs} --disable-warnings {toxinidir}/tests
coverage report -m --format markdown
coverage xml
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 --no-isolation
twine check dist/*
[testenv:circular]
description = ensure there are no cyclic dependencies
use_develop = true
skip_install = false
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_
# """
##