ironic/tox.ini
Riccardo Pittau 5165edaf93 Update minversion of tox
The minimum version since when tox accepts having inline comments
in deps is 3.9.0

https://tox.readthedocs.io/en/latest/changelog.html#v3-9-0-2019-04-17

Change-Id: I4d2aaf97459344ca01e5ccd6e563474c094a4678
2021-01-21 14:57:07 +01:00

167 lines
5.5 KiB
INI
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[tox]
minversion = 3.9.0
skipsdist = True
envlist = py3,pep8
ignore_basepython_conflict=true
[testenv]
usedevelop = True
basepython = python3
setenv = VIRTUAL_ENV={envdir}
PYTHONDONTWRITEBYTECODE = 1
LANGUAGE=en_US
LC_ALL=en_US.UTF-8
PYTHONWARNINGS=default::DeprecationWarning
TESTS_DIR=./ironic/tests/unit/
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
stestr run {posargs}
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
[testenv:unit-with-driver-libs]
deps = {[testenv]deps}
-r{toxinidir}/driver-requirements.txt
[testenv:genstates]
deps = {[testenv]deps}
pydot2
commands = {toxinidir}/tools/states_to_dot.py -f {toxinidir}/doc/source/images/states.svg --format svg
[testenv:pep8]
usedevelop = False
deps=
hacking>=3.1.0,<4.0.0 # Apache-2.0
doc8>=0.6.0 # Apache-2.0
pycodestyle>=2.0.0,<2.7.0 # MIT
flake8-import-order>=0.17.1 # LGPLv3
Pygments>=2.2.0 # BSD
bashate>=0.5.1 # Apache-2.0
whitelist_externals = bash
commands =
bash tools/flake8wrap.sh {posargs}
# Run bashate during pep8 runs to ensure violations are caught by
# the check and gate queues.
{toxinidir}/tools/run_bashate.sh {toxinidir}
# Check the *.rst files
doc8 README.rst CONTRIBUTING.rst doc/source --ignore D001
# Check to make sure reno releasenotes created with 'reno new'
{toxinidir}/tools/check-releasenotes.py
[testenv:cover]
setenv = VIRTUAL_ENV={envdir}
LANGUAGE=en_US
PYTHON=coverage run --source ironic --omit='*tests*' --parallel-mode
commands =
coverage erase
stestr run {posargs}
coverage combine
coverage report --omit='*tests*'
coverage html -d ./cover --omit='*tests*'
[testenv:genconfig]
sitepackages = False
envdir = {toxworkdir}/venv
commands =
oslo-config-generator --config-file=tools/config/ironic-config-generator.conf
[testenv:genpolicy]
sitepackages = False
envdir = {toxworkdir}/venv
commands =
oslopolicy-sample-generator --config-file=tools/policy/ironic-policy-generator.conf
[testenv:debug]
commands = oslo_debug_helper -t ironic/tests/unit {posargs}
[testenv:docs]
# NOTE(dtantsur): documentation building process requires importing ironic
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -b html -W doc/source doc/build/html
[testenv:pdf-docs]
whitelist_externals = make
deps = {[testenv:docs]deps}
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:api-ref]
usedevelop = False
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
whitelist_externals = bash
commands =
bash -c 'rm -rf api-ref/build'
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:releasenotes]
usedevelop = False
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:venv]
setenv = PYTHONHASHSEED=0
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/doc/requirements.txt
commands = {posargs}
[flake8]
# [E129] visually indented line with same indent as next logical line
# [E741] ambiguous variable name
# [W503] Line break before binary operator.
ignore = E129,E741,W503
filename = *.py,app.wsgi
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
import-order-style = pep8
application-import-names = ironic
max-complexity=18
# [H106] Don't put vim configuration in source files.
# [H203] Use assertIs(Not)None to check for None.
# [H204] Use assert(Not)Equal to check for equality.
# [H205] Use assert(Greater|Less)(Equal) for comparison.
# [H210] Require autospec, spec, or spec_set in mock.patch/mock.patch.object calls
# [H904] Delay string interpolations at logging calls.
enable-extensions=H106,H203,H204,H205,H210,H904
# TODO(rpittau) remove the ignores below when we're ready to apply H210 to
# the various modules. This can be done in batches changing the filters.
per-file-ignores =
ironic/cmd/__init__.py:E402
ironic/tests/base.py:E402
ironic/tests/unit/api/controllers/v1/test_volume_target.py:H210
ironic/tests/unit/api/controllers/v1/test_volume_connector.py:H210
ironic/tests/unit/api/controllers/v1/test_driver.py:H210
ironic/tests/unit/api/controllers/v1/test_portgroup.py:H210
ironic/tests/unit/api/controllers/v1/test_chassis.py:H210
ironic/tests/unit/api/controllers/v1/test_node.py:H210
ironic/tests/unit/api/controllers/v1/test_types.py:H210
ironic/tests/unit/api/controllers/v1/test_notification_utils.py:H210
ironic/tests/unit/api/controllers/v1/test_port.py:H210
ironic/tests/unit/drivers/modules/test_console_utils.py:H210
[hacking]
import_exceptions = testtools.matchers, ironic.common.i18n
[flake8:local-plugins]
# [N323] Found use of _() without explicit import of _!
extension =
N323 = checks:check_explicit_underscore_import
paths = ./ironic/hacking/
[testenv:bandit]
usedevelop = False
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r ironic -x tests -n5 -ll -c tools/bandit.yml