ironic/tox.ini
Julia Kreger 17c3de3413 Fix doc builds for ironic
It seems that the wsme sphinx extension was concealing
issues in our doc builds, where formatting was not exactly
correct nor parsed as we would always expect as we have had
a tendency to fully document data structures as if we are
typing code.

Upon disabling the extension, the prior build failures due to
duplicate labels disappeared and other issues preventing the
docs from building successfully were raised.

It also seems that we never actually used the extension as
documented https://wsme.readthedocs.io/en/latest/document.html

$ grep -ir "wsme:root" ./ironic
$ grep -ir "wsme:type" ./ironic
$ grep -ir "wsme:attribute" ./ironic
$ grep -ir "wsme:service" ./ironic
$ grep -ir "autotype" ./ironic
./ironic/objects/fields.py:class FlexibleDictField(object_fields.AutoTypedField):
./ironic/objects/fields.py:class MACAddressField(object_fields.AutoTypedField):
$ grep -ir "autoattribute" ./ironic
$ grep -ir "autoservice" ./ironic
$ grep -ir "autofunction" ./ironic
$

Co-Authored-By: Dmitry Tantsur <dtantsur@redhat.com>
Change-Id: Ib5bbd9274a4098022fba69f0e4998485d2ee2396
Story: 2003020
Task:  23043
2018-09-05 19:24:55 +02:00

150 lines
4.6 KiB
INI

[tox]
minversion = 1.8
skipsdist = True
envlist = py3,py27,pep8
[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
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:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-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]
basepython = python2
deps = {[testenv]deps}
-r{toxinidir}/driver-requirements.txt
[testenv:genstates]
basepython = python3
deps = {[testenv]deps}
pydot2
commands = {toxinidir}/tools/states_to_dot.py -f {toxinidir}/doc/source/images/states.svg --format svg
[testenv:pep8]
basepython = python3
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]
basepython = python3
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:checkconfig]
basepython = python3
sitepackages = False
envdir = {toxworkdir}/venv
commands =
{toxinidir}/tools/config/check_uptodate.sh
[testenv:genconfig]
basepython = python3
sitepackages = False
envdir = {toxworkdir}/venv
commands =
oslo-config-generator --config-file=tools/config/ironic-config-generator.conf
[testenv:genpolicy]
basepython = python3
sitepackages = False
envdir = {toxworkdir}/venv
commands =
oslopolicy-sample-generator --config-file=tools/policy/ironic-policy-generator.conf
[testenv:debug]
basepython = python3
commands = oslo_debug_helper -t ironic/tests/unit {posargs}
[testenv:docs]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -b html -W doc/source doc/build/html
[testenv:api-ref]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-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]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:venv]
basepython = python3
setenv = PYTHONHASHSEED=0
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/doc/requirements.txt
commands = {posargs}
[flake8]
# [W503] Line break before binary operator.
# NOTE(TheJulia): Adding W606 to the ignore list
# until we are able to remove them due to deprecation
# period passing. Patch merged in March 2018 to rename
# method arguments from reserved keywords.
ignore = E129,W503,W606
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.
# [H904] Delay string interpolations at logging calls.
enable-extensions=H106,H203,H204,H205,H904
[hacking]
local-check-factory = ironic.hacking.checks.factory
import_exceptions = testtools.matchers, ironic.common.i18n
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt