-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtox.ini
134 lines (120 loc) · 3.75 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
[tox]
minversion = 3.18.0
envlist = py3,functional,pep8
[testenv]
usedevelop = true
allowlist_externals =
rm
setenv =
PYTHONDONTWRITEBYTECODE=1
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands = stestr run {posargs}
# NOTE(cdent): Do not set envdir here as it confuses tox-siblings.
# gate functional jobs, which use the 'functional' path when
# copying files.
[testenv:functional]
description =
Run functional tests using python3.
# As osc-placement functional tests import the PlacementFixture from the placement
# repository these tests are, by default, set up to run with openstack-placement
# from pypi. In the gate, Zuul will use the installed version of placement (stable
# branch version on stable gate run) OR the version of placement the Depends-On in
# the commit message suggests. If you want to run the tests with latest master from
# the placement repo, modify the dep line to point at master, example:
# deps =
# {[testenv]deps}
# git+https://opendev.org/openstack/placement#egg=openstack-placement
# If you want to run the test locally with an un-merged placement change,
# modify the dep line to point to your dependency or pip install placement
# into the appropriate tox virtualenv.
# NOTE: We express the requirement here instead of test-requirements
# because we do not want placement present during unit tests.
deps =
{[testenv]deps}
openstack-placement>=1.0.0
commands = stestr --test-path=./osc_placement/tests/functional run {posargs}
[testenv:functional-py39]
description =
Run functional tests using python3.9.
deps = {[testenv:functional]deps}
commands =
{[testenv:functional]commands}
[testenv:functional-py310]
description =
Run functional tests using python3.10.
deps = {[testenv:functional]deps}
commands =
{[testenv:functional]commands}
[testenv:functional-py311]
description =
Run functional tests using python3.11.
deps = {[testenv:functional]deps}
commands =
{[testenv:functional]commands}
[testenv:functional-py312]
description =
Run functional tests using python3.12.
deps = {[testenv:functional]deps}
commands =
{[testenv:functional]commands}
[testenv:pep8]
description =
Run style checks.
commands = flake8 {posargs}
[testenv:cover]
description =
Run unit tests with coverage enabled.
setenv =
{[testenv]setenv}
PYTHON=coverage run --source osc_placement --parallel-mode
commands =
coverage erase
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:docs]
description =
Build main documentation.
deps =
-r{toxinidir}/doc/requirements.txt
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
commands =
rm -rf doc/build
sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html
[testenv:pdf-docs]
description =
Build PDF documentation.
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]
description =
Build release notes.
deps = {[testenv:docs]deps}
commands =
rm -rf releasenotes/build
sphinx-build -W -b html -d releasenotes/build/doctrees releasenotes/source releasenotes/build/html
[testenv:venv]
commands = {posargs}
# The docs requirements are included here for creating release notes, e.g.:
# tox -e venv -- reno new <slug>
deps =
{[testenv]deps}
-r{toxinidir}/doc/requirements.txt
[testenv:debug]
commands = oslo_debug_helper {posargs}
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
# W503 line break before binary operator
show-source = true
ignore = E123,E125,W503
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build