2013-05-02 14:50:57 -04:00
|
|
|
|
[tox]
|
2021-05-18 11:13:22 +02:00
|
|
|
|
minversion = 3.18.0
|
2013-09-30 22:55:00 +08:00
|
|
|
|
skipsdist = True
|
2019-11-20 15:52:10 +01:00
|
|
|
|
envlist = py3,pep8
|
2019-12-19 12:44:00 +01:00
|
|
|
|
ignore_basepython_conflict=true
|
2013-05-02 14:50:57 -04:00
|
|
|
|
|
|
|
|
|
[testenv]
|
2013-09-30 22:55:00 +08:00
|
|
|
|
usedevelop = True
|
2020-12-14 09:51:01 +01:00
|
|
|
|
basepython = python3
|
2013-05-02 14:50:57 -04:00
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2014-09-12 12:04:50 +01:00
|
|
|
|
PYTHONDONTWRITEBYTECODE = 1
|
2015-03-13 08:42:51 -07:00
|
|
|
|
LANGUAGE=en_US
|
2015-09-30 09:39:46 -07:00
|
|
|
|
LC_ALL=en_US.UTF-8
|
2016-09-30 00:29:08 +08:00
|
|
|
|
PYTHONWARNINGS=default::DeprecationWarning
|
2018-07-06 16:24:01 +02:00
|
|
|
|
deps =
|
2020-10-30 13:50:47 +08:00
|
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-07-06 16:24:01 +02:00
|
|
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2017-06-13 17:30:19 +03:00
|
|
|
|
commands =
|
2021-02-11 12:44:32 +01:00
|
|
|
|
stestr run --slowest {posargs}
|
2015-06-15 09:59:20 +09:00
|
|
|
|
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
2014-03-31 20:42:46 +02:00
|
|
|
|
|
2020-02-27 16:40:05 +01:00
|
|
|
|
[testenv:unit-with-driver-libs]
|
2019-03-08 11:13:19 +00:00
|
|
|
|
deps = {[testenv]deps}
|
|
|
|
|
-r{toxinidir}/driver-requirements.txt
|
|
|
|
|
|
2015-04-27 11:00:29 -07:00
|
|
|
|
[testenv:genstates]
|
|
|
|
|
deps = {[testenv]deps}
|
|
|
|
|
pydot2
|
2015-06-03 16:56:08 -07:00
|
|
|
|
commands = {toxinidir}/tools/states_to_dot.py -f {toxinidir}/doc/source/images/states.svg --format svg
|
2015-04-27 11:00:29 -07:00
|
|
|
|
|
2013-05-02 14:50:57 -04:00
|
|
|
|
[testenv:pep8]
|
2020-12-14 14:00:25 +01:00
|
|
|
|
usedevelop = False
|
2020-12-08 21:20:20 +01:00
|
|
|
|
deps=
|
2021-07-28 11:33:15 +02:00
|
|
|
|
hacking>=4.1.0,<5.0.0 # Apache-2.0
|
2020-12-08 21:20:20 +01:00
|
|
|
|
doc8>=0.6.0 # Apache-2.0
|
2021-07-28 11:33:15 +02:00
|
|
|
|
pycodestyle>=2.0.0,<3.0.0 # MIT
|
2020-12-08 21:20:20 +01:00
|
|
|
|
flake8-import-order>=0.17.1 # LGPLv3
|
|
|
|
|
Pygments>=2.2.0 # BSD
|
|
|
|
|
bashate>=0.5.1 # Apache-2.0
|
2021-05-18 11:13:22 +02:00
|
|
|
|
allowlist_externals = bash
|
2013-05-02 14:50:57 -04:00
|
|
|
|
commands =
|
2015-12-22 15:46:46 +08:00
|
|
|
|
bash tools/flake8wrap.sh {posargs}
|
2015-12-17 17:45:30 +00:00
|
|
|
|
# Run bashate during pep8 runs to ensure violations are caught by
|
|
|
|
|
# the check and gate queues.
|
2016-09-21 09:02:08 -07:00
|
|
|
|
{toxinidir}/tools/run_bashate.sh {toxinidir}
|
2016-01-27 10:36:33 +00:00
|
|
|
|
# Check the *.rst files
|
2018-05-24 08:33:56 +07:00
|
|
|
|
doc8 README.rst CONTRIBUTING.rst doc/source --ignore D001
|
2018-02-22 11:01:21 -08:00
|
|
|
|
# Check to make sure reno releasenotes created with 'reno new'
|
|
|
|
|
{toxinidir}/tools/check-releasenotes.py
|
2013-05-02 14:50:57 -04:00
|
|
|
|
|
|
|
|
|
[testenv:cover]
|
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2015-03-13 08:42:51 -07:00
|
|
|
|
LANGUAGE=en_US
|
2017-09-19 12:34:01 +00:00
|
|
|
|
PYTHON=coverage run --source ironic --omit='*tests*' --parallel-mode
|
2013-05-02 14:50:57 -04:00
|
|
|
|
commands =
|
2016-04-17 19:59:30 +03:00
|
|
|
|
coverage erase
|
2018-06-06 19:04:13 +03:00
|
|
|
|
stestr run {posargs}
|
2017-09-19 12:34:01 +00:00
|
|
|
|
coverage combine
|
|
|
|
|
coverage report --omit='*tests*'
|
|
|
|
|
coverage html -d ./cover --omit='*tests*'
|
2013-05-02 14:50:57 -04:00
|
|
|
|
|
2014-06-20 13:53:17 -04:00
|
|
|
|
[testenv:genconfig]
|
2014-09-29 15:59:36 -07:00
|
|
|
|
sitepackages = False
|
|
|
|
|
envdir = {toxworkdir}/venv
|
2014-06-20 13:53:17 -04:00
|
|
|
|
commands =
|
2015-11-19 14:50:38 +08:00
|
|
|
|
oslo-config-generator --config-file=tools/config/ironic-config-generator.conf
|
2014-06-20 13:53:17 -04:00
|
|
|
|
|
2016-06-03 15:43:12 -07:00
|
|
|
|
[testenv:genpolicy]
|
|
|
|
|
sitepackages = False
|
|
|
|
|
envdir = {toxworkdir}/venv
|
|
|
|
|
commands =
|
2017-07-25 13:30:59 +05:30
|
|
|
|
oslopolicy-sample-generator --config-file=tools/policy/ironic-policy-generator.conf
|
2016-06-03 15:43:12 -07:00
|
|
|
|
|
2016-06-03 10:21:33 +01:00
|
|
|
|
[testenv:debug]
|
|
|
|
|
commands = oslo_debug_helper -t ironic/tests/unit {posargs}
|
|
|
|
|
|
2015-05-20 16:36:35 +02:00
|
|
|
|
[testenv:docs]
|
2020-12-14 14:00:25 +01:00
|
|
|
|
# NOTE(dtantsur): documentation building process requires importing ironic
|
2018-03-16 01:35:19 +09:00
|
|
|
|
deps =
|
2020-10-30 13:50:47 +08:00
|
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2020-12-14 14:00:25 +01:00
|
|
|
|
-r{toxinidir}/requirements.txt
|
2018-03-16 01:35:19 +09:00
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2018-09-05 07:26:02 -07:00
|
|
|
|
commands = sphinx-build -b html -W doc/source doc/build/html
|
2014-11-14 17:14:19 +00:00
|
|
|
|
|
2019-09-06 11:57:18 +08:00
|
|
|
|
[testenv:pdf-docs]
|
2021-05-18 11:13:22 +02:00
|
|
|
|
allowlist_externals = make
|
2019-09-06 11:57:18 +08:00
|
|
|
|
deps = {[testenv:docs]deps}
|
|
|
|
|
commands =
|
|
|
|
|
sphinx-build -W -b latex doc/source doc/build/pdf
|
|
|
|
|
make -C doc/build/pdf
|
|
|
|
|
|
|
|
|
|
|
2016-05-03 13:24:10 -04:00
|
|
|
|
[testenv:api-ref]
|
2020-12-14 14:00:25 +01:00
|
|
|
|
usedevelop = False
|
2018-03-16 01:35:19 +09:00
|
|
|
|
deps =
|
2020-10-30 13:50:47 +08:00
|
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-03-16 01:35:19 +09:00
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2021-05-18 11:13:22 +02:00
|
|
|
|
allowlist_externals = bash
|
2016-05-03 13:24:10 -04:00
|
|
|
|
commands =
|
2016-05-16 12:18:26 +00:00
|
|
|
|
bash -c 'rm -rf api-ref/build'
|
2016-05-03 13:24:10 -04:00
|
|
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
|
|
|
|
|
2015-11-05 08:29:42 -08:00
|
|
|
|
[testenv:releasenotes]
|
2020-12-14 14:00:25 +01:00
|
|
|
|
usedevelop = False
|
2018-03-16 01:35:19 +09:00
|
|
|
|
deps =
|
2020-10-30 13:50:47 +08:00
|
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-03-16 01:35:19 +09:00
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2017-04-05 14:49:42 -07:00
|
|
|
|
commands =
|
|
|
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
2015-11-05 08:29:42 -08:00
|
|
|
|
|
2013-05-02 14:50:57 -04:00
|
|
|
|
[testenv:venv]
|
2014-08-25 12:48:10 -07:00
|
|
|
|
setenv = PYTHONHASHSEED=0
|
2018-04-19 11:45:42 +09:00
|
|
|
|
deps =
|
2020-10-30 13:50:47 +08:00
|
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-04-19 11:45:42 +09:00
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2013-05-02 14:50:57 -04:00
|
|
|
|
commands = {posargs}
|
|
|
|
|
|
|
|
|
|
[flake8]
|
2020-05-12 12:02:32 +02:00
|
|
|
|
# [E129] visually indented line with same indent as next logical line
|
|
|
|
|
# [E741] ambiguous variable name
|
2018-04-10 16:48:00 -07:00
|
|
|
|
# [W503] Line break before binary operator.
|
2020-05-12 12:02:32 +02:00
|
|
|
|
ignore = E129,E741,W503
|
2017-11-28 15:25:04 +07:00
|
|
|
|
filename = *.py,app.wsgi
|
2015-12-23 01:24:02 +00:00
|
|
|
|
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
2017-02-16 09:35:28 -08:00
|
|
|
|
import-order-style = pep8
|
2017-03-16 07:20:35 -07:00
|
|
|
|
application-import-names = ironic
|
2021-03-02 15:42:19 -08:00
|
|
|
|
max-complexity=19
|
2018-02-26 05:56:57 +00:00
|
|
|
|
# [H106] Don't put vim configuration in source files.
|
2016-11-08 10:07:56 -08:00
|
|
|
|
# [H203] Use assertIs(Not)None to check for None.
|
2017-09-07 10:10:07 -07:00
|
|
|
|
# [H204] Use assert(Not)Equal to check for equality.
|
|
|
|
|
# [H205] Use assert(Greater|Less)(Equal) for comparison.
|
2020-04-28 14:44:43 +02:00
|
|
|
|
# [H210] Require ‘autospec’, ‘spec’, or ‘spec_set’ in mock.patch/mock.patch.object calls
|
2016-11-08 10:07:56 -08:00
|
|
|
|
# [H904] Delay string interpolations at logging calls.
|
2020-04-28 14:44:43 +02:00
|
|
|
|
enable-extensions=H106,H203,H204,H205,H210,H904
|
2021-03-08 18:53:49 +01:00
|
|
|
|
# [E402] Module level import not at top of file
|
2020-04-28 14:44:43 +02:00
|
|
|
|
per-file-ignores =
|
2020-05-12 12:02:32 +02:00
|
|
|
|
ironic/cmd/__init__.py:E402
|
|
|
|
|
ironic/tests/base.py:E402
|
2013-11-19 08:15:25 +08:00
|
|
|
|
|
|
|
|
|
[hacking]
|
2014-09-11 21:04:47 +00:00
|
|
|
|
import_exceptions = testtools.matchers, ironic.common.i18n
|
2018-03-22 13:44:01 -04:00
|
|
|
|
|
2020-03-28 12:00:14 +01:00
|
|
|
|
[flake8:local-plugins]
|
|
|
|
|
# [N323] Found use of _() without explicit import of _!
|
|
|
|
|
extension =
|
|
|
|
|
N323 = checks:check_explicit_underscore_import
|
|
|
|
|
paths = ./ironic/hacking/
|
|
|
|
|
|
2019-06-03 15:04:41 +08:00
|
|
|
|
[testenv:bandit]
|
2020-12-14 14:00:25 +01:00
|
|
|
|
usedevelop = False
|
2019-06-03 15:04:41 +08:00
|
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2019-06-20 14:10:54 +08:00
|
|
|
|
commands = bandit -r ironic -x tests -n5 -ll -c tools/bandit.yml
|
2021-07-13 14:34:36 +02:00
|
|
|
|
|
|
|
|
|
[testenv:lower-constraints]
|
|
|
|
|
deps =
|
|
|
|
|
-c{toxinidir}/lower-constraints.txt
|
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
|
-r{toxinidir}/requirements.txt
|