ironic-inspector/tox.ini
Andreas Jaeger 1a8c1bb370 Cleanup py27 support
This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
  know about the requirement
- Remove obsolete sections from setup.cfg
- Update classifiers
- Update requirements, no need for python_version anymore
- Switch to using sphinx-build with apidoc extension
- Use newer openstackdocstheme version
- Remove Babel requirement, this is not needed.

Change-Id: I4176d8002d45449171aa5f7a7caef196ab7900d0
2020-04-20 08:18:51 +02:00

115 lines
3.3 KiB
INI

[tox]
minversion = 3.1.0
envlist = py3,pep8,functional-py36
ignore_basepython_conflict=true
[testenv]
basepython = python3
usedevelop = True
install_command = pip install -U {opts} {packages}
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
stestr run {posargs}
setenv =
VIRTUAL_ENV={envdir}
PYTHONDONTWRITEBYTECODE=1
TZ=UTC
TESTS_DIR=./ironic_inspector/test/unit/
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
[testenv:venv]
commands = {posargs}
[testenv:api-ref]
whitelist_externals = bash
commands =
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:cover]
setenv =
{[testenv]setenv}
PYTHON=coverage run --branch --omit='*test*' --source ironic_inspector --parallel-mode
commands =
coverage erase
stestr run {posargs}
coverage combine
coverage report -m --omit='*test*' --fail-under 90
coverage html -d ./cover --omit='*test*'
[testenv:pep8]
commands =
flake8 ironic_inspector
doc8 README.rst CONTRIBUTING.rst doc/source
[testenv:functional-py36]
commands =
python3 -m ironic_inspector.test.functional {posargs}
[testenv:genconfig]
envdir = {toxworkdir}/venv
commands = oslo-config-generator --config-file {toxinidir}/tools/config-generator.conf
[testenv:genpolicy]
sitepackages = False
envdir = {toxworkdir}/venv
commands = oslopolicy-sample-generator --config-file {toxinidir}/tools/policy-generator.conf
[testenv:genstates]
deps = {[testenv]deps}
commands = {toxinidir}/tools/states_to_dot.py -f {toxinidir}/doc/source/images/states.svg --format svg
[flake8]
max-complexity=15
# [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.
# [H904] Delay string interpolations at logging calls.
enable-extensions=H106,H203,H204,H205,H904
import-order-style = pep8
application-import-names = ironic_inspector
[hacking]
import_exceptions = ironic_inspector.common.i18n
[testenv:docs]
setenv = PYTHONHASHSEED=0
sitepackages = False
deps = -r{toxinidir}/test-requirements.txt
commands =
sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
whitelist_externals = make
deps = {[testenv:docs]deps}
commands =
sphinx-build -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:lower-constraints]
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
[testenv:bandit]
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r ironic_inspector -x test -n 5 -ll -c tools/bandit.yml
# 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