From 9bc12e66695588960c9a53e5f974d16de5fe5b6e Mon Sep 17 00:00:00 2001
From: qingszhao <zhao.daqing@99cloud.net>
Date: Tue, 12 Jun 2018 15:09:06 +0800
Subject: [PATCH] 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: Ie0eca8c8627ab67c7c4aeccdc8607e36a259f13c
---
 tox.ini | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tox.ini b/tox.ini
index 44fdaebc8f..e5cf82f239 100644
--- a/tox.ini
+++ b/tox.ini
@@ -20,9 +20,11 @@ commands =
   python setup.py test --slowest --testr-args='{posargs}'
 
 [testenv:debug]
+basepython = python3
 commands = oslo_debug_helper -t tests {posargs}
 
 [testenv:cover]
+basepython = python3
 setenv = VIRTUAL_ENV={envdir}
          NOSE_WITH_COVERAGE=1
          NOSE_COVER_BRANCHES=1
@@ -31,6 +33,7 @@ setenv = VIRTUAL_ENV={envdir}
 commands = python setup.py testr --coverage --testr-args='{posargs}'
 
 [testenv:pep8]
+basepython = python3
 # sphinx needs to be installed to make doc8 work properly
 deps =
     {[testenv]deps}
@@ -45,9 +48,11 @@ commands =
   yamllint .
 
 [testenv:bandit]
+basepython = python3
 commands = bandit -r ansible kolla_ansible tests tools
 
 [testenv:venv]
+basepython = python3
 deps =
   -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
   -r{toxinidir}/test-requirements.txt
@@ -55,6 +60,7 @@ deps =
 commands = {posargs}
 
 [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
@@ -64,6 +70,7 @@ commands =
   sphinx-build -W -b html doc/source doc/build/html
 
 [testenv:deploy-guide]
+basepython = python3
 deps =
    -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
    -r{toxinidir}/requirements.txt
@@ -74,11 +81,13 @@ commands =
   sphinx-build -a -E -W -d deploy-guide/build/doctrees -b html deploy-guide/source deploy-guide/build/html
 
 [testenv:setupenv]
+basepython = python3
 commands =
   {toxinidir}/tools/setup_gate.sh
   {toxinidir}/tools/dump_info.sh
 
 [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