f10e1013c1
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: Ia979ebfd5e98032b3f2a554017165348c5a3ca9c
96 lines
2.6 KiB
INI
96 lines
2.6 KiB
INI
[tox]
|
|
minversion = 2.0
|
|
envlist = py35,py27,pep8,docs
|
|
skipsdist = True
|
|
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
install_command = pip install {opts} {packages}
|
|
setenv =
|
|
PYTHONWARNINGS=default::DeprecationWarning
|
|
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
|
|
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
|
|
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
whitelist_externals = sh
|
|
rm
|
|
find
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
stestr run --slowest {posargs}
|
|
passenv = http_proxy
|
|
HTTP_PROXY
|
|
https_proxy
|
|
HTTPS_PROXY
|
|
no_proxy
|
|
NO_PROXY
|
|
OS_DEBUG
|
|
OS_LOG_CAPTURE
|
|
OS_STDERR_CAPTURE
|
|
OS_STDOUT_CAPTURE
|
|
TRACE_FAILONLY
|
|
|
|
[testenv:pep8]
|
|
basepython = python3
|
|
commands =
|
|
flake8
|
|
{[testenv:bandit]commands}
|
|
|
|
[testenv:py27]
|
|
setenv = OS_FAIL_ON_MISSING_DEPS=1
|
|
|
|
[testenv:venv]
|
|
basepython = python3
|
|
commands = {posargs}
|
|
|
|
[testenv:cover]
|
|
basepython = python3
|
|
setenv =
|
|
{[testenv]setenv}
|
|
PYTHON=coverage run --source vmware_nsx_tempest --parallel-mode
|
|
commands =
|
|
stestr run --no-subunit-trace {posargs}
|
|
coverage combine
|
|
coverage html -d cover
|
|
coverage xml -o cover/coverage.xml
|
|
|
|
[testenv:docs]
|
|
basepython = python3
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands = sphinx-build -W -b html doc/source doc/build/html
|
|
|
|
[testenv:releasenotes]
|
|
basepython = python3
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
[testenv:debug]
|
|
basepython = python3
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
[flake8]
|
|
# E123, E125 skipped as they are invalid PEP-8.
|
|
|
|
show-source = True
|
|
ignore = E125,E126,E128,E129,E265,H305,H307,H404,H405,H904,N530,N531
|
|
builtins = _
|
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.ropeproject
|
|
import-order-style = pep8
|
|
|
|
[testenv:bandit]
|
|
basepython = python3
|
|
# B108 hardcoded_tmp_directory - remove when fixed
|
|
# B602 subprocess_popen_with_shell_equals_true - removed when fixed
|
|
# B605 start_process_with_a_shell - remove when fixed
|
|
commands = bandit -r vmware_nsx_tempest_plugin -n 5 -s B108,B602,B605 -ll
|