armada/tox.ini
huang.zhiping 99ced61d3e fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: I3f2720a6e8e6c685d2e5ca288008be20785a8309
2018-06-10 15:38:40 +00:00

82 lines
1.9 KiB
INI

[tox]
skipsdist = True
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 =
find
flake8
rm
commands =
find . -type f -name "*.pyc" -delete
rm -Rf .testrepository/times.dbm
[testenv:py35]
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 = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:pep8]
basepython = python3
deps =
.[bandit]
{[testenv]deps}
commands =
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
[flake8]
filename = *.py
ignore =
exclude = .git,.tox,dist,*lib/python*,*egg,build,releasenotes,doc/*,hapi,venv