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.

Decode subprocess output so it has the right type under python 3.

Change-Id: Id2df5439fa6e788199bec4ac7c98c56347053621
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-06-06 14:50:07 -04:00
parent f641e9aeaa
commit 236297973f
2 changed files with 6 additions and 2 deletions

View File

@ -74,7 +74,7 @@ copyright = u'2016, DreamHost'
#
# The short X.Y version.
version = subprocess.Popen(['sh', '-c', 'cd ../..; python setup.py --version'],
stdout=subprocess.PIPE).stdout.read()
stdout=subprocess.PIPE).stdout.read().decode('utf-8')
version = version.strip()
# The full version, including alpha/beta/rc tags.
release = version

View File

@ -3,7 +3,6 @@ minversion = 2.0
envlist = py35,py27,pep8,docs
[testenv]
basepython = python3
install_command = pip install {opts} {packages}
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
@ -16,6 +15,7 @@ commands = python setup.py testr --testr-args='{posargs}'
basepython = python2.7
[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
@ -24,6 +24,7 @@ deps =
commands = {posargs}
[testenv:pep8]
basepython = python3
deps =
-r{toxinidir}/test-requirements.txt
flake8
@ -34,6 +35,7 @@ commands =
bandit -r stevedore -x tests -n5
[testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html
@ -43,12 +45,14 @@ show-source = True
exclude=.venv,.git,.tox,dist,*lib/python*,*egg,build
[testenv:releasenotes]
basepython = python3
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt