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 the output of subprocess in doc/source/conf.py so that we always
have a string.

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

View File

@ -63,7 +63,7 @@ copyright = u'%s, OpenStack Foundation' % datetime.date.today().year
#
# 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 = 1.8
envlist = py27,py35,py{27,35}-{zookeeper,redis,sentinel,memcached,postgresql,mysql,consul,etcd,etcd3,etcd3gw},pep8
[testenv]
basepython = python3
# We need to install a bit more than just `test' because those drivers have
# custom tests that we always run
deps = .[test,zake,ipc,memcached,mysql,etcd,etcd3,etcd3gw]
@ -40,18 +39,22 @@ commands =
basepython = python2.7
[testenv:venv]
basepython = python3
# This target is used by the gate go run Sphinx to build the doc
deps = {[testenv:docs]deps}
commands = {posargs}
[testenv:cover]
basepython = python3
commands = python setup.py testr --slowest --coverage --testr-args="{posargs}"
[testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:pep8]
basepython = python3
deps = hacking<0.13,>=0.12
doc8
commands =
@ -63,5 +66,6 @@ exclude=.venv,.git,.tox,dist,*egg,*.egg-info,build,examples,doc
show-source = True
[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html