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: I9aaae4949e2cf6c8a33fb6fbf8be15e1d09cce44
This commit is contained in:
huang.zhiping 2018-06-09 09:24:44 +08:00 committed by Mark Goddard
parent f034ae4741
commit 18b5498050
1 changed files with 14 additions and 2 deletions

16
tox.ini
View File

@ -24,6 +24,7 @@ deps =
commands = stestr run {posargs}
[testenv:pep8]
basepython = python3
commands =
{toxinidir}/tools/run-bashate.sh
flake8 {posargs} kayobe
@ -33,13 +34,16 @@ commands =
{toxinidir}/tools/sphinx8 README.rst CONTRIBUTING.rst doc/source --ignore D001
[testenv:venv]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike}
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/queens}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/doc/requirements.txt
commands = {posargs}
[testenv:ansible]
# Kolla currently fails during password generation under python3. Revisit in Rocky.
basepython = python2
usedevelop = True
# Create the virtualenv with access to system site packages, as this is
# required to use the python and apt modules, which are not available via PyPI.
@ -52,6 +56,8 @@ commands =
{toxinidir}/tools/test-ansible.sh {posargs}
[testenv:molecule]
# Molecule only supports python 2.7 and 3.6.
basepython = python2
whitelist_externals =
bash
sudo
@ -67,9 +73,11 @@ commands =
sudo bash -c "source {envdir}/bin/activate && {toxinidir}/tools/test-molecule.sh {posargs}"
[testenv:alint]
basepython = python3
commands = ansible-lint ansible/*.yaml
[testenv:ansible-syntax]
basepython = python3
commands =
# Install ansible role dependencies from Galaxy.
ansible-galaxy install \
@ -90,6 +98,7 @@ commands =
{posargs}"
[testenv:cover]
basepython = python3
setenv =
VIRTUAL_ENV={envdir}
PYTHON=coverage run --source kayobe --parallel-mode
@ -102,6 +111,7 @@ commands =
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?h=stable/queens}
-r{toxinidir}/requirements.txt
@ -109,11 +119,13 @@ deps =
commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:debug]
basepython = python3
commands = oslo_debug_helper {posargs}
[testenv:releasenotes]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike}
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/queens}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands =