blazar/tox.ini

117 lines
3.5 KiB
INI

[tox]
envlist = py36,py38,pep8
minversion = 3.1.1
skipsdist = True
ignore_basepython_conflict = True
[testenv]
basepython = python3
usedevelop = True
whitelist_externals = rm
install_command = pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
deps =
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
setenv = VIRTUAL_ENV={envdir}
DISCOVER_DIRECTORY=blazar/tests
PYTHONHASHSEED=0
commands =
lockutils-wrapper python setup.py testr --slowest --testr-args="{posargs}"
sitepackages = False
[testenv:cover]
setenv =
{[testenv]setenv}
PYTHON=coverage run --source blazar --parallel-mode
commands =
coverage erase
lockutils-wrapper python setup.py testr --testr-args="{posargs}"
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:pep8]
commands = flake8 {posargs}
[testenv:venv]
commands = {posargs}
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
rm -rf doc/html doc/build
rm -rf doc/source/apidoc doc/source/api
sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
whitelist_externals = make
commands =
sphinx-build --keep-going -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:genconfig]
commands = oslo-config-generator --config-file=etc/blazar/blazar-config-generator.conf
[flake8]
show-source = true
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,api-ref
# NOTE(tonyb): Ignore a few errors/warnings that are now "on by default".
# W503 line break before binary operator
# W504 line break after binary operator
# E402 module level import not at top of file
ignore=H105,H238,E123,E402,W503,W504
# [H904] Delay string interpolations at logging calls.
enable-extensions=H904
# To get a list of functions that have a complexity of 17 or more, set
# max-complexity to 17 and run 'tox -epep8'.
# 23 is currently the most complex thing we have:
# 'ManagerService.update_lease' - blazar/manager/service.py
max-complexity=23
[flake8:local-plugins]
extension =
C312 = checks:no_translate_logs
paths = ./blazar/hacking
[testenv:pylint]
deps = -r{toxinidir}/requirements.txt
pylint==1.9.1
commands = pylint blazar
[testenv:releasenotes]
deps = {[testenv:docs]deps}
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
[testenv:api-ref]
# This environment is called from CI scripts to test and publish
# the API Ref to docs.openstack.org.
commands =
rm -rf api-ref/build
sphinx-build -WE --keep-going -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:genpolicy]
commands =
oslopolicy-sample-generator --config-file etc/blazar/blazar-policy-generator.conf
[testenv:lower-constraints]
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
# 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