
Python 3.6 is installed by default in Ubuntu 18.04 LTS. Therefore, according to Transition Plan [1], it'll be handy to have py36 testenv. For more details, please check Python2 Deprecation Timeline [2] and Python3-first Goal - Completion Criteria [3]. [1] https://wiki.ubuntu.com/Python/Python36Transition [2] https://governance.openstack.org/tc/resolutions/20180529-python2-deprecation-timeline.html [3] https://review.openstack.org/#/c/575933/8/goals/stein/python3-first.rst@42 Change-Id: I275d0ffe7b03cf564d02f575f92dd5bb395c7b48
96 lines
2.2 KiB
INI
96 lines
2.2 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
|
|
rm
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
rm -Rf .testrepository/times.dbm
|
|
|
|
[testenv:py35]
|
|
commands =
|
|
{[testenv]commands}
|
|
stestr run {posargs}
|
|
stestr slowest
|
|
|
|
[testenv:py36]
|
|
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 =
|
|
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
|
|
ignore =
|
|
exclude = .git,.tox,dist,*lib/python*,*egg,build,releasenotes,doc/*,hapi,venv
|