-
Notifications
You must be signed in to change notification settings - Fork 116
/
tox.ini
166 lines (149 loc) · 3.95 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
[tox]
envlist = py3,pep8
minversion = 3.18.0
# This is the default env for tests, which is going to be used for all py3*
[testenv]
description =
Run unit tests.
usedevelop = True
install_command = python -I -m pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
LANGUAGE=en_US
LC_ALL=en_US.utf-8
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=160
PYTHONDONTWRITEBYTECODE=1
deps =
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
allowlist_externals =
bash
commands =
bash {toxinidir}/tools/prepare_db.sh sqlite
stestr run --color {posargs}
stestr slowest
[testenv:pep8]
description =
Run pep8 tests.
commands =
doc8 doc/source
flake8 {posargs} . {toxinidir}/tools/sync_db.py
[testenv:fast8]
description =
Run style checks on the changes made since HEAD~. For a full run including docs, use 'pep8'
commands =
bash tools/flake8wrap.sh -HEAD
# Deprecated
[testenv:unit-postgresql]
description =
Run unit tests with postgresql backend.
commands =
bash {toxinidir}/tools/prepare_db.sh postgresql
stestr run --color {posargs}
stestr slowest
# Deprecated
[testenv:unit-mysql]
description =
Run unit tests with mysql backend.
commands =
bash {toxinidir}/tools/prepare_db.sh mysql
stestr run --color {posargs}
stestr slowest
[testenv:cover]
description =
Run coverage tests.
setenv =
{[testenv]setenv}
PYTHON=coverage run --source mistral --parallel-mode
commands =
coverage erase
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:genconfig]
description =
Build mistral.conf sample file.
commands =
oslo-config-generator \
--config-file=tools/config/config-generator.mistral.conf \
--output-file=etc/mistral.conf.sample
[testenv:genpolicy]
description =
Build policy.yaml sample file.
commands =
oslopolicy-sample-generator \
--config-file=tools/config/policy-generator.mistral.conf \
--output-file=etc/policy.yaml.sample
[testenv:venv]
deps =
{[testenv]deps}
-r{toxinidir}/doc/requirements.txt
commands =
{posargs}
[testenv:docs]
description =
Build main documentation.
deps =
-r{toxinidir}/doc/requirements.txt
-r{toxinidir}/requirements.txt
allowlist_externals =
rm
commands =
rm -rf doc/build
sphinx-build -E -W --keep-going -b html doc/source doc/build/html
[testenv:pdf-docs]
description =
Build PDF documentation.
deps = {[testenv:docs]deps}
allowlist_externals =
rm
make
commands =
rm -rf doc/build/pdf
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:releasenotes]
description =
Generate release notes.
deps = {[testenv:docs]deps}
allowlist_externals =
rm
commands =
rm -rf releasenotes/build
sphinx-build -W --keep-going -b html -j auto releasenotes/source releasenotes/build/html
[testenv:api-ref]
description =
Generate the API ref. Called from CI scripts to test and publish to docs.openstack.org.
deps = {[testenv:docs]deps}
allowlist_externals =
rm
commands =
rm -rf api-ref/build
sphinx-build -W --keep-going -b html -j auto api-ref/source api-ref/build/html
#Skip PEP257 violation.
[flake8]
ignore = D100,D101,D102,D103,D104,D105,D200,D203,D202,D204,D205,D208,D400,D401,E402,W503,E731,W504
show-source = true
builtins = _
# [H106] Don't put vim configuration in source files.
# [H203] Use assertIs(Not)None to check for None.
# [H904] Delay string interpolations at logging calls.
enable-extensions = H106,H203,H904
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,scripts
[doc8]
extensions = .rst, .yaml, .mistral
# Maximal line length should be 80.
max-line-length = 80
[hacking]
import_exceptions = mistral._i18n
[flake8:local-plugins]
extension =
M001 = checks:CheckForLoggingIssues
M319 = checks:no_assert_equal_true_false
M320 = checks:no_assert_true_false_is_not
O323 = checks:check_oslo_namespace_imports
paths = ./mistral/hacking