-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathtox.ini
190 lines (169 loc) · 5.41 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
[tox]
minversion = 3.18.0
envlist = pep8,py3
[testenv]
usedevelop = True
setenv =
VIRTUAL_ENV={envdir}
LANGUAGE=en_US
LC_ALL=en_US.utf-8
# TODO(stephenfin): Remove once we bump our upper-constraint to SQLAlchemy 2.0
SQLALCHEMY_WARN_20=1
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
stestr run {posargs}
passenv =
HTTP_PROXY
HTTPS_PROXY
NO_PROXY
OS_DEBUG
GENERATE_HASHES
[testenv:functional]
commands =
stestr --test-path=./masakari/tests/functional run --concurrency=1 --slowest {posargs}
[testenv:genconfig]
commands =
oslo-config-generator --config-file=etc/masakari/masakari-config-generator.conf
oslo-config-generator --config-file=etc/masakari/masakari-customized-recovery-flow-config-generator.conf
[testenv:genpolicy]
commands =
oslopolicy-sample-generator --config-file=etc/masakari/masakari-policy-generator.conf
[testenv:linters]
skip_install = True
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
{[testenv:bashate]deps}
commands =
{[testenv:pep8]commands}
{[testenv:doc8]commands}
{[testenv:yamllint]commands}
{[testenv:bashate]commands}
[testenv:pep8]
skip_install = True
deps = {[testenv:linters]deps}
commands = flake8 {posargs}
[testenv:doc8]
skip_install = True
deps = {[testenv:linters]deps}
commands =
doc8 README.rst CONTRIBUTING.rst HACKING.rst doc/source
doc8 releasenotes/source
doc8 -e '.yaml' releasenotes/notes
doc8 -e '.rst' -e '.inc' api-ref/source
[testenv:yamllint]
skip_install = True
deps = {[testenv:linters]deps}
commands = yamllint -s .
[testenv:bashate]
skip_install = True
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
bashate
commands =
bashate devstack/plugin.sh -v --ignore E006 --error E005,E042,E043
[testenv:venv]
commands = {posargs}
[testenv:cover]
setenv =
VIRTUAL_ENV={envdir}
PYTHON=coverage run --source masakari --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:docs]
# NOTE(elod.illes): requirements.txt is needed because otherwise
# dependencies are installed during 'develop-inst' tox phase without
# constraints which could cause failures in stable branches.
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
make
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:releasenotes]
skip_install = True
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
allowlist_externals =
rm
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:debug]
commands = oslo_debug_helper {posargs}
[testenv:api-ref]
# This environment is called from CI scripts to test and publish
# the API Ref to docs.openstack.org.
deps = {[testenv:docs]deps}
allowlist_externals =
rm
commands =
rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[flake8]
show-source = True
# E123, E125 skipped as they are invalid PEP-8.
# The below hacking rules by default are disabled should be enabled:
# [H106] Don't put vim configuration in source files.
# [H203] Use assertIs(Not)None to check for None.
# [E231] missing whitespace after ','
# [H904] Delay string interpolations at logging calls.
enable-extensions = H106,H203,H904
# [W504] line break after binary operator (use W503 instead)
ignore = E123,E125,E128,E231,E731,H405,W504
builtins = _
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[hacking]
import_exceptions = masakari.i18n
[flake8:local-plugins]
extension =
M301 = checks:no_db_session_in_public_api
M302 = checks:use_timeutils_utcnow
M303 = checks:capital_cfg_help
M305 = checks:assert_true_instance
M306 = checks:assert_equal_type
M308 = checks:no_translate_logs
M309 = checks:no_import_translation_in_tests
M310 = checks:no_setting_conf_directly_in_tests
M315 = checks:no_mutable_default_args
M316 = checks:check_explicit_underscore_import
M317 = checks:use_jsonutils
M318 = checks:assert_true_or_false_with_in
M319 = checks:assert_raises_regexp
M320 = checks:dict_constructor_with_list_copy
M321 = checks:assert_equal_in
M322 = checks:check_greenthread_spawns
M323 = checks:check_no_contextlib_nested
M324 = checks:check_config_option_in_central_place
M325 = checks:check_doubled_words
M326 = checks:check_python3_no_iteritems
M327 = checks:check_python3_no_iterkeys
M328 = checks:check_python3_no_itervalues
M329 = checks:no_os_popen
M331 = checks:no_log_warn
M332 = checks:yield_followed_by_space
M333 = checks:check_policy_registration_in_central_place
M334 = checks:check_policy_enforce
paths = ./masakari/hacking
[testenv:bindep]
skip_install = True
deps = bindep
commands = bindep test
[doc8]
# NOTE(yoctozepto): this is due to multiple violations - it is better to keep
# it limited sanely rather than disable the D001 "Line too long" rule altogether
max-line-length = 105