senlin/tox.ini

116 lines
3.0 KiB
INI

[tox]
minversion = 3.1.1
envlist = py37,pep8,functional
ignore_basepython_conflict = True
skipsdist = True
[testenv]
basepython = python3
setenv =
VIRTUAL_ENV={envdir}
LANGUAGE=C.UTF-8
LC_ALL=C.UTF-8
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:180}
PYTHONDONTWRITEBYTECODE=1
PYTHONWARNINGS=default::DeprecationWarning,ignore::DeprecationWarning:distutils,ignore::DeprecationWarning:site
passenv =
http_proxy
HTTP_PROXY
https_proxy
HTTPS_PROXY
no_proxy
NO_PROXY
OS_DEBUG
usedevelop = True
install_command =
pip install {opts} {packages}
commands =
find . -type f -name "*.py[c|o]" -delete
stestr run {posargs}
stestr slowest
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals =
bash
find
rm
[testenv:debug]
basepython = python3
commands = oslo_debug_helper -t senlin/tests/unit {posargs}
[testenv:debug-py36]
basepython = python3.6
commands = oslo_debug_helper -t senlin/tests/unit {posargs}
[testenv:pep8]
commands =
flake8 senlin doc/source/ext
[testenv:genconfig]
envdir = {toxworkdir}/venv
commands =
{toxinidir}/tools/gen-config
[testenv:genpolicy]
envdir = {toxworkdir}/venv
commands =
{toxinidir}/tools/gen-policy
[testenv:venv]
commands = {posargs}
[testenv:cover]
setenv =
{[testenv]setenv}
PYTHON=coverage run --source senlin --parallel-mode
commands = {toxinidir}/tools/cover.sh {posargs}
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -W --keep-going -b html doc/source doc/build/html
whitelist_externals = rm
[testenv:releasenotes]
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
[testenv:api-ref]
deps = -r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -W --keep-going -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[flake8]
# Temporarily disable complaints about docstring for public module/class/method
# H106 Don't put vim configuration in source files
# H203 Use assertIs(Not)None to check for None
ignore = D100,D101,D102,D103,D104,D105,D200,D201,D202,D204,D205,D300,D301,D400,D401,I100,I201,W504,W605
enable-extensions=H106,H203,H204,H205
show-source = true
exclude=.venv,.git,.tox,cover,dist,*lib/python*,*egg,tools,build,releasenotes
max-complexity=20
[hacking]
import_exceptions = senlin.common.i18n
[flake8:local-plugins]
extension =
S318 = checks:assert_equal_none
S319 = checks:use_jsonutils
S320 = checks:no_mutable_default_args
S321 = checks:check_api_version_decorator
S322 = checks:no_log_warn
S323 = checks:assert_equal_true
paths = ./senlin/hacking
[testenv:bandit]
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r senlin -x tests -s B101,B104,B110,B310,B311,B506