armada/tox.ini
Andreas Jaeger cb737354f0 Fix Flake8 3.6.0 errors
Flake8 3.6.0 now warns about both line break after and *before* binary
operator, you have to choose whether you use W503 or W504. Disable the
newer W504.

Fix "F841 local variable 'e' is assigned to but never used".

Handle warnings about invalid escape sequence in regex.

Handle invalid escape sequence in string.

Change-Id: I68efbde4e9dd2e6e9455d91313eb45c9c79d35ce
2018-10-26 09:23:42 -04:00

110 lines
2.5 KiB
INI

[tox]
skipsdist = True
minversion = 2.3.1
envlist = py35, pep8, cover, bandit
[testenv]
deps=
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
passenv=HTTP_PROXY HTTPS_PROXY http_proxy https_proxy NO_PROXY no_proxy
setenv=
VIRTUAL_ENV={envdir}
usedevelop = True
install_command = pip install {opts} {packages}
whitelist_externals =
bash
find
rm
commands =
find . -type f -name "*.pyc" -delete
rm -Rf .testrepository/times.dbm
[testenv:venv]
basepython=python3
commands =
{posargs}
[testenv:py35]
basepython = python3.5
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:py36]
basepython = python3.6
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
sphinx-build -W -b html doc/source doc/build/html
[testenv:genconfig]
basepython = python3
commands =
oslo-config-generator --config-file=etc/armada/config-generator.conf
[testenv:genpolicy]
basepython = python3
commands =
oslopolicy-sample-generator --config-file=etc/armada/policy-generator.conf
[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:pep8]
basepython = python3
deps =
yapf
.[bandit]
{[testenv]deps}
commands =
# Whitespace linter (for chart files)
bash {toxinidir}/tools/whitespace-linter.sh
yapf -dr {toxinidir}/armada {toxinidir}/setup.py
flake8 {posargs}
# Run security linter as part of the pep8 gate instead of a separate zuul job.
bandit -r armada -x armada/tests -n 5
[testenv:bandit]
basepython = python3
commands =
bandit -r armada -x armada/tests -n 5
[testenv:cover]
basepython = python3
setenv = {[testenv]setenv}
PYTHON=coverage run --source armada --parallel-mode
commands =
coverage erase
find . -type f -name "*.pyc" -delete
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:yapf]
basepython = python3
commands =
yapf -ir {toxinidir}/armada {toxinidir}/setup.py
[flake8]
filename = *.py
# These are ignored intentionally:
# W504 - line break after binary operator, we cannot have both
# W503 and W504 enabled
ignore = W504
exclude = .git,.tox,dist,*lib/python*,*egg,build,releasenotes,doc/*,hapi,venv