-
Notifications
You must be signed in to change notification settings - Fork 66
/
tox.ini
163 lines (144 loc) · 4.57 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
[tox]
minversion = 4.0.0
# specify virtualenv here to keep local runs consistent with the
# gate (it sets the versions of pip, setuptools, and wheel)
requires = virtualenv>=20.17.1
# this allows tox to infer the base python from the environment name
# and override any basepython configured in this file
ignore_basepython_conflict=true
envlist = py3,pep8
[testenv]
basepython = python3
usedevelop = True
setenv =
VIRTUAL_ENV={envdir}
OS_TEST_PATH=./os_brick/tests
OS_TEST_TIMEOUT=60
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
# By default stestr will set concurrency
# to ncpu, to specify something else use
# the concurrency=<n> option.
# call example: 'tox -epy37 -- --concurrency=4'
commands =
stestr run {posargs}
stestr slowest
allowlist_externals = bash
find
passenv =
http_proxy
HTTP_PROXY
https_proxy
HTTPS_PROXY
no_proxy
NO_PROXY
[testenv:debug]
commands =
find . -type f -name "*.pyc" -delete
oslo_debug_helper {posargs}
[testenv:pep8]
commands =
flake8 {posargs} .
doc8
[testenv:fast8]
allowlist_externals =
{toxinidir}/tools/fast8.sh
commands =
{toxinidir}/tools/fast8.sh
[testenv:bandit]
deps = -r{toxinidir}/test-requirements.txt
# B101: skip assert used checks, they are validly used for mypy
commands: bandit -r os_brick -x os_brick/tests -n5 -sB101
[testenv:pylint]
allowlist_externals =
{toxinidir}/tools/coding-checks.sh
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
pylint==2.17.3
commands =
{toxinidir}/tools/coding-checks.sh --pylint {posargs:all}
[testenv:venv]
commands = {posargs}
[testenv:cover]
# To see the report of missing coverage add to commands
# coverage report --show-missing
setenv =
{[testenv]setenv}
PYTHON=coverage run --source os_brick --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage/xml
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
rm -fr doc/build doc/source/contributor/api/ .autogenerated
sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html
allowlist_externals = rm
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
commands =
{[testenv:docs]commands}
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
allowlist_externals =
{[testenv:docs]allowlist_externals}
make
[testenv:releasenotes]
deps = {[testenv:docs]deps}
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]
# Following checks are ignored on purpose.
#
# E251 unexpected spaces around keyword / parameter equals
# reason: no improvement in readability
# W503 line break before binary operator
# reason: pep8 itself is not sure about this one and
# reversed this rule in 2016
# W504 line break after binary operator
# reason: no agreement on this being universally
# preferable for our code. Disabled to keep checking
# tools from getting in our way with regards to this.
# H101 include name with TODO
# reason: no real benefit
# G200 Logging statements should not include the exception
# reason: Many existing cases of this that may be legitimate
#
show-source = True
ignore = E251,W503,W504,H101,G200
enable-extensions=H106,H203,H204,H205
builtins = _
exclude=.venv,.git,.tox,dist,*lib/python*,*egg,build
max-complexity=30
application-import-names = os_brick
import-order-style = pep8
[doc8]
ignore-path=.tox,*.egg-info,doc/src/api,doc/source/drivers.rst,doc/build,.eggs/*/EGG-INFO/*.txt,doc/source/configuration/tables,./*.txt,releasenotes/build
extension=.txt,.rst,.inc
[hacking]
import_exceptions = os_brick.i18n, typing
[testenv:bindep]
# Do not install any requirements. We want this to be fast and work even if
# system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed
# separately, outside of the requirements files, and develop mode disabled
# explicitly to avoid unnecessarily installing the checked-out repo too
skip_install = True
deps = bindep
commands = bindep {posargs}
usedevelop = False
[testenv:mypy]
description =
Run type checks.
setenv =
OS_MYPY_OPTS=--install-types --non-interactive
commands =
bash tools/mypywrap.sh {posargs}