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.

Co-Authored-By: Nguyen Hai <nguyentrihai93@gmail.com>
Change-Id: I6f4a539c68b036474be4ba433cb28293c0ce94e2
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann
2018-06-06 17:58:18 -04:00
committed by Nguyen Hai
parent 2c0629e7d9
commit f0640571d1

View File

@@ -25,12 +25,14 @@ commands = sh -c "find . -type d -name '.?*' -prune -o \
whitelist_externals = sh whitelist_externals = sh
[testenv:pep8] [testenv:pep8]
basepython = python3
commands = commands =
flake8 flake8
{[testenv:bandit]commands} {[testenv:bandit]commands}
distribute = false distribute = false
[testenv:venv] [testenv:venv]
basepython = python3
commands = {posargs} commands = {posargs}
[testenv:functional] [testenv:functional]
@@ -44,19 +46,23 @@ setenv =
OS_NEUTRONCLIENT_EXEC_DIR = {envdir}/bin OS_NEUTRONCLIENT_EXEC_DIR = {envdir}/bin
[testenv:cover] [testenv:cover]
basepython = python3
commands = commands =
python setup.py test --coverage --coverage-package-name=neutronclient --testr-args='{posargs}' python setup.py test --coverage --coverage-package-name=neutronclient --testr-args='{posargs}'
coverage report coverage report
[testenv:docs] [testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:releasenotes] [testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8] [flake8]
basepython = python3
show-source = true show-source = true
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools
import-order-style = pep8 import-order-style = pep8
@@ -65,6 +71,7 @@ import-order-style = pep8
enable-extensions=H904 enable-extensions=H904
[testenv:bandit] [testenv:bandit]
basepython = python3
# B303: blacklist calls: md5, sha1 # B303: blacklist calls: md5, sha1
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r neutronclient -x tests -n5 -s B303 commands = bandit -r neutronclient -x tests -n5 -s B303