2014-10-10 15:34:45 +02:00
|
|
|
[tox]
|
2021-06-03 16:53:55 +08:00
|
|
|
minversion = 3.18.0
|
2020-12-14 14:18:46 +01:00
|
|
|
skipsdist = True
|
2020-10-09 18:13:58 +08:00
|
|
|
envlist = py3,pep8,functional-py38
|
2019-12-20 16:24:13 +01:00
|
|
|
ignore_basepython_conflict=true
|
2014-10-10 16:17:51 +02:00
|
|
|
|
2014-10-10 15:34:45 +02:00
|
|
|
[testenv]
|
2019-11-20 14:00:57 +08:00
|
|
|
basepython = python3
|
2014-10-10 15:34:45 +02:00
|
|
|
usedevelop = True
|
2014-10-10 16:17:51 +02:00
|
|
|
deps =
|
2020-11-01 16:09:33 +08:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2019-07-12 15:43:55 +08:00
|
|
|
-r{toxinidir}/requirements.txt
|
2015-01-16 14:08:32 +01:00
|
|
|
-r{toxinidir}/test-requirements.txt
|
2014-10-10 16:17:51 +02:00
|
|
|
commands =
|
2018-06-27 14:51:25 -04:00
|
|
|
stestr run {posargs}
|
2017-09-28 10:43:07 +00:00
|
|
|
setenv =
|
|
|
|
VIRTUAL_ENV={envdir}
|
|
|
|
PYTHONDONTWRITEBYTECODE=1
|
|
|
|
TZ=UTC
|
|
|
|
TESTS_DIR=./ironic_inspector/test/unit/
|
2015-06-15 09:53:20 +09:00
|
|
|
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
2014-10-10 16:17:51 +02:00
|
|
|
|
2015-06-18 16:08:07 +02:00
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
|
|
|
|
2017-08-14 15:51:38 +03:00
|
|
|
[testenv:api-ref]
|
2020-12-14 14:18:46 +01:00
|
|
|
usedevelop = False
|
|
|
|
deps =
|
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2021-06-03 16:53:55 +08:00
|
|
|
allowlist_externals = bash
|
2017-08-14 15:51:38 +03:00
|
|
|
commands =
|
|
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
|
|
|
|
2015-11-23 13:46:45 +01:00
|
|
|
[testenv:releasenotes]
|
2020-12-14 14:18:46 +01:00
|
|
|
usedevelop = False
|
|
|
|
deps =
|
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2015-11-23 13:46:45 +01:00
|
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
|
2015-10-06 09:01:26 -05:00
|
|
|
[testenv:cover]
|
2017-09-28 10:43:07 +00:00
|
|
|
setenv =
|
|
|
|
{[testenv]setenv}
|
|
|
|
PYTHON=coverage run --branch --omit='*test*' --source ironic_inspector --parallel-mode
|
2015-10-06 09:01:26 -05:00
|
|
|
commands =
|
2017-09-28 10:43:07 +00:00
|
|
|
coverage erase
|
2018-06-27 14:51:25 -04:00
|
|
|
stestr run {posargs}
|
2017-09-28 10:43:07 +00:00
|
|
|
coverage combine
|
|
|
|
coverage report -m --omit='*test*' --fail-under 90
|
|
|
|
coverage html -d ./cover --omit='*test*'
|
2015-10-06 09:01:26 -05:00
|
|
|
|
2014-11-10 14:14:59 +01:00
|
|
|
[testenv:pep8]
|
2020-12-14 14:18:46 +01:00
|
|
|
usedevelop = False
|
2020-12-09 15:19:33 +01:00
|
|
|
deps =
|
|
|
|
flake8-import-order>=0.17.1 # LGPLv3
|
2021-07-29 11:19:36 +02:00
|
|
|
hacking>=4.1.0,<5.0.0 # Apache-2.0
|
|
|
|
pycodestyle>=2.0.0,<3.0.0 # MIT
|
2020-12-14 10:03:45 +01:00
|
|
|
doc8>=0.8.1 # Apache-2.0
|
2014-10-10 16:17:51 +02:00
|
|
|
commands =
|
2015-06-29 12:22:41 +02:00
|
|
|
flake8 ironic_inspector
|
2020-07-28 12:45:09 +02:00
|
|
|
doc8 -e .rst -e .inc README.rst CONTRIBUTING.rst doc/source api-ref/source
|
2014-11-14 15:34:32 +01:00
|
|
|
|
2020-10-09 18:13:58 +08:00
|
|
|
[testenv:functional-py38]
|
2015-08-13 14:51:13 +02:00
|
|
|
commands =
|
2019-07-18 14:25:41 +02:00
|
|
|
python3 -m ironic_inspector.test.functional {posargs}
|
2015-08-13 14:51:13 +02:00
|
|
|
|
2015-03-11 04:33:48 +00:00
|
|
|
[testenv:genconfig]
|
2015-07-08 20:48:09 +02:00
|
|
|
envdir = {toxworkdir}/venv
|
2018-10-11 12:07:09 +08:00
|
|
|
commands = oslo-config-generator --config-file {toxinidir}/tools/config-generator.conf
|
2015-07-08 20:48:09 +02:00
|
|
|
|
2017-09-27 09:26:58 +00:00
|
|
|
[testenv:genpolicy]
|
|
|
|
sitepackages = False
|
|
|
|
envdir = {toxworkdir}/venv
|
2018-10-11 12:07:09 +08:00
|
|
|
commands = oslopolicy-sample-generator --config-file {toxinidir}/tools/policy-generator.conf
|
2017-09-27 09:26:58 +00:00
|
|
|
|
2017-02-22 17:26:12 +02:00
|
|
|
[testenv:genstates]
|
|
|
|
deps = {[testenv]deps}
|
|
|
|
commands = {toxinidir}/tools/states_to_dot.py -f {toxinidir}/doc/source/images/states.svg --format svg
|
|
|
|
|
2015-07-08 20:48:09 +02:00
|
|
|
[flake8]
|
2018-08-03 16:38:07 +08:00
|
|
|
max-complexity=15
|
2017-10-12 14:56:24 -07:00
|
|
|
# [H106] Don't put vim configuration in source files.
|
2016-11-09 05:37:10 -08:00
|
|
|
# [H203] Use assertIs(Not)None to check for None.
|
2017-10-12 15:02:32 -07:00
|
|
|
# [H204] Use assert(Not)Equal to check for equality.
|
|
|
|
# [H205] Use assert(Greater|Less)(Equal) for comparison.
|
2020-11-04 17:06:23 +01:00
|
|
|
# [H210] Require 'autospec', 'spec', or 'spec_set' in mock.patch/mock.patch.object calls
|
2016-11-09 05:37:10 -08:00
|
|
|
# [H904] Delay string interpolations at logging calls.
|
2020-04-28 12:14:47 +02:00
|
|
|
enable-extensions=H106,H203,H204,H205,H210,H904
|
2017-02-16 10:11:06 -08:00
|
|
|
import-order-style = pep8
|
2017-10-12 14:56:24 -07:00
|
|
|
application-import-names = ironic_inspector
|
2015-07-08 20:48:09 +02:00
|
|
|
|
|
|
|
[hacking]
|
2020-03-24 10:18:09 +01:00
|
|
|
import_exceptions = ironic_inspector.common.i18n
|
2015-11-18 17:27:05 +02:00
|
|
|
|
|
|
|
[testenv:docs]
|
|
|
|
setenv = PYTHONHASHSEED=0
|
|
|
|
sitepackages = False
|
2020-12-14 14:18:46 +01:00
|
|
|
# NOTE(dtantsur): documentation building process requires importing ironic
|
2020-11-18 09:59:35 +08:00
|
|
|
deps =
|
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2020-12-14 14:18:46 +01:00
|
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2015-11-18 17:27:05 +02:00
|
|
|
commands =
|
2020-04-16 18:40:09 +02:00
|
|
|
sphinx-build -W -b html doc/source doc/build/html
|
2018-03-22 13:44:49 -04:00
|
|
|
|
2019-09-06 15:25:44 +08:00
|
|
|
[testenv:pdf-docs]
|
2021-06-03 16:53:55 +08:00
|
|
|
allowlist_externals = make
|
2019-09-06 15:25:44 +08:00
|
|
|
deps = {[testenv:docs]deps}
|
|
|
|
commands =
|
|
|
|
sphinx-build -b latex doc/source doc/build/pdf
|
|
|
|
make -C doc/build/pdf
|
|
|
|
|
2018-03-22 13:44:49 -04:00
|
|
|
[testenv:lower-constraints]
|
|
|
|
deps =
|
|
|
|
-c{toxinidir}/lower-constraints.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/requirements.txt
|
2019-06-03 14:40:46 +08:00
|
|
|
|
|
|
|
[testenv:bandit]
|
2020-12-14 14:18:46 +01:00
|
|
|
usedevelop = False
|
|
|
|
deps =
|
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2019-06-20 11:23:30 +08:00
|
|
|
commands = bandit -r ironic_inspector -x test -n 5 -ll -c tools/bandit.yml
|
|
|
|
|
2019-12-24 13:01:43 +05:30
|
|
|
# This environment can be used to quickly validate that all needed system
|
|
|
|
# packages required to successfully execute test targets are installed
|
|
|
|
[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.
|
|
|
|
deps = bindep
|
|
|
|
commands = bindep test
|
|
|
|
|