Skip to content

Commit 4b2aa93

Browse files
committed
tox: Install extras
Install these via tox.ini when required. Note that we don't add them to 'test-requirements.txt' since packagers consume those and would be forced to package these dependencies or modify this file. A small bug in the tox file is corrected: you can't share an environment directory if the dependencies in that directory are different. As such, pep8 must go in its own directory again, not the 'shared' directory. Change-Id: Iffb9ff2e300213ec01cccaf3b967e73331c9c9ff Signed-off-by: Stephen Finucane <[email protected]>
1 parent 86d87be commit 4b2aa93

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

tox.ini

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ deps =
2929
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
3030
-r{toxinidir}/requirements.txt
3131
-r{toxinidir}/test-requirements.txt
32+
extras =
33+
powervm
34+
zvm
35+
hyperv
36+
vmware
3237
passenv =
3338
OS_DEBUG GENERATE_HASHES
3439
# there is also secret magic in subunit-trace which lets you run in a fail only
@@ -42,16 +47,17 @@ commands =
4247
description =
4348
Run type checks.
4449
envdir = {toxworkdir}/shared
50+
extras =
4551
commands =
4652
bash tools/mypywrap.sh {posargs}
4753

4854
[testenv:pep8]
4955
description =
5056
Run style checks.
51-
envdir = {toxworkdir}/shared
5257
deps =
5358
{[testenv]deps}
5459
autopep8
60+
extras =
5561
commands =
5662
{[testenv:mypy]commands}
5763
# check if autopep8 would alter the formatting but don't actually change it
@@ -68,6 +74,7 @@ commands =
6874
bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'
6975

7076
[testenv:autopep8]
77+
extras =
7178
deps = autopep8
7279
commands =
7380
autopep8 --exit-code --max-line-length=79 --in-place -r nova doc setup.py
@@ -76,6 +83,7 @@ commands =
7683
description =
7784
Run style checks on the changes made since HEAD~. For a full run including docs, use 'pep8'
7885
envdir = {toxworkdir}/shared
86+
extras =
7987
commands =
8088
bash tools/flake8wrap.sh -HEAD
8189

@@ -84,6 +92,7 @@ description =
8492
Determine whether a backport is ready to be merged by checking whether it has
8593
already been merged to master or more recent stable branches.
8694
deps =
95+
extras =
8796
skipsdist = true
8897
commands =
8998
bash tools/check-cherry-picks.sh
@@ -108,6 +117,7 @@ description =
108117
deps =
109118
{[testenv]deps}
110119
openstack-placement>=1.0.0
120+
extras =
111121
commands =
112122
stestr --test-path=./nova/tests/functional run {posargs}
113123
stestr slowest
@@ -116,20 +126,23 @@ commands =
116126
description =
117127
Run functional tests using python3.6.
118128
deps = {[testenv:functional]deps}
129+
extras =
119130
commands =
120131
{[testenv:functional]commands}
121132

122133
[testenv:functional-py37]
123134
description =
124135
Run functional tests using python3.7.
125136
deps = {[testenv:functional]deps}
137+
extras =
126138
commands =
127139
{[testenv:functional]commands}
128140

129141
[testenv:functional-py38]
130142
description =
131143
Run functional tests using python3.8.
132144
deps = {[testenv:functional]deps}
145+
extras =
133146
commands =
134147
{[testenv:functional]commands}
135148

@@ -140,13 +153,15 @@ description =
140153
placement-nova-tox-functional-py38 job which is defined and
141154
run in placement.
142155
deps = {[testenv:functional]deps}
156+
extras =
143157
commands =
144158
stestr --test-path=./nova/tests/functional run --exclude-regex '((?:api|notification)_sample_tests|functional\.db\.)' {posargs}
145159

146160
[testenv:functional-py39]
147161
description =
148162
Run functional tests using python3.9.
149163
deps = {[testenv:functional]deps}
164+
extras =
150165
commands =
151166
{[testenv:functional]commands}
152167

@@ -157,17 +172,20 @@ setenv =
157172
GENERATE_SAMPLES=True
158173
PYTHONHASHSEED=0
159174
deps = {[testenv:functional]deps}
175+
extras =
160176
commands =
161177
stestr --test-path=./nova/tests/functional/api_sample_tests run {posargs}
162178
stestr slowest
163179

164180
[testenv:genconfig]
165181
envdir = {toxworkdir}/shared
182+
extras =
166183
commands =
167184
oslo-config-generator --config-file=etc/nova/nova-config-generator.conf
168185

169186
[testenv:genpolicy]
170187
envdir = {toxworkdir}/shared
188+
extras =
171189
commands =
172190
oslopolicy-sample-generator --config-file=etc/nova/nova-policy-generator.conf
173191

@@ -180,6 +198,7 @@ envdir = {toxworkdir}/shared
180198
setenv =
181199
{[testenv]setenv}
182200
PYTHON=coverage run --source nova --parallel-mode
201+
extras =
183202
commands =
184203
coverage erase
185204
stestr run {posargs}
@@ -190,13 +209,15 @@ commands =
190209

191210
[testenv:debug]
192211
envdir = {toxworkdir}/shared
212+
extras =
193213
commands =
194214
oslo_debug_helper {posargs}
195215

196216
[testenv:venv]
197217
deps =
198218
{[testenv]deps}
199219
-r{toxinidir}/doc/requirements.txt
220+
extras =
200221
commands =
201222
{posargs}
202223

@@ -208,6 +229,7 @@ description =
208229
deps =
209230
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
210231
-r{toxinidir}/doc/requirements.txt
232+
extras =
211233
commands =
212234
rm -rf doc/build/html doc/build/doctrees
213235
sphinx-build -W --keep-going -b html -j auto doc/source doc/build/html
@@ -219,6 +241,7 @@ description =
219241
Build PDF documentation.
220242
envdir = {toxworkdir}/docs
221243
deps = {[testenv:docs]deps}
244+
extras =
222245
commands =
223246
rm -rf doc/build/pdf
224247
sphinx-build -W --keep-going -b latex -j auto doc/source doc/build/pdf
@@ -229,6 +252,7 @@ description =
229252
Generate the API guide. Called from CI scripts to test and publish to docs.openstack.org.
230253
envdir = {toxworkdir}/docs
231254
deps = {[testenv:docs]deps}
255+
extras =
232256
commands =
233257
rm -rf api-guide/build
234258
sphinx-build -W --keep-going -b html -j auto api-guide/source api-guide/build/html
@@ -238,6 +262,7 @@ description =
238262
Generate the API ref. Called from CI scripts to test and publish to docs.openstack.org.
239263
envdir = {toxworkdir}/docs
240264
deps = {[testenv:docs]deps}
265+
extras =
241266
commands =
242267
rm -rf api-ref/build
243268
sphinx-build -W --keep-going -b html -j auto api-ref/source api-ref/build/html
@@ -247,6 +272,7 @@ description =
247272
Generate release notes.
248273
envdir = {toxworkdir}/docs
249274
deps = {[testenv:docs]deps}
275+
extras =
250276
commands =
251277
rm -rf releasenotes/build
252278
sphinx-build -W --keep-going -b html -j auto releasenotes/source releasenotes/build/html
@@ -256,6 +282,7 @@ description =
256282
Build all documentation including API guides and refs.
257283
envdir = {toxworkdir}/docs
258284
deps = {[testenv:docs]deps}
285+
extras =
259286
commands =
260287
{[testenv:docs]commands}
261288
{[testenv:api-guide]commands}
@@ -266,6 +293,7 @@ commands =
266293
# NOTE(browne): This is required for the integration test job of the bandit
267294
# project. Please do not remove.
268295
envdir = {toxworkdir}/shared
296+
extras =
269297
commands = bandit -r nova -x tests -n 5 -ll
270298

271299
[flake8]
@@ -358,6 +386,7 @@ paths =
358386
# explicitly to avoid unnecessarily installing the checked-out repo too
359387
usedevelop = False
360388
deps = bindep
389+
extras =
361390
commands =
362391
bindep test
363392

0 commit comments

Comments
 (0)