Browse Source

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>
tags/1.63.0
Doug Hellmann 1 year ago
parent
commit
bb234731d3
2 changed files with 6 additions and 2 deletions
  1. 1
    1
      doc/source/conf.py
  2. 5
    1
      tox.ini

+ 1
- 1
doc/source/conf.py View File

@@ -63,7 +63,7 @@ copyright = u'%s, OpenStack Foundation' % datetime.date.today().year
63 63
 #
64 64
 # The short X.Y version.
65 65
 version = subprocess.Popen(['sh', '-c', 'cd ../..; python setup.py --version'],
66
-                           stdout=subprocess.PIPE).stdout.read()
66
+                           stdout=subprocess.PIPE).stdout.read().decode('utf-8')
67 67
 version = version.strip()
68 68
 # The full version, including alpha/beta/rc tags.
69 69
 release = version

+ 5
- 1
tox.ini View File

@@ -3,7 +3,6 @@ minversion = 1.8
3 3
 envlist = py27,py35,py{27,35}-{zookeeper,redis,sentinel,memcached,postgresql,mysql,consul,etcd,etcd3,etcd3gw},pep8
4 4
 
5 5
 [testenv]
6
-basepython = python3
7 6
 # We need to install a bit more than just `test' because those drivers have
8 7
 # custom tests that we always run
9 8
 deps = .[test,zake,ipc,memcached,mysql,etcd,etcd3,etcd3gw]
@@ -40,18 +39,22 @@ commands =
40 39
 basepython = python2.7
41 40
 
42 41
 [testenv:venv]
42
+basepython = python3
43 43
 # This target is used by the gate go run Sphinx to build the doc
44 44
 deps = {[testenv:docs]deps}
45 45
 commands = {posargs}
46 46
 
47 47
 [testenv:cover]
48
+basepython = python3
48 49
 commands = python setup.py testr --slowest --coverage --testr-args="{posargs}"
49 50
 
50 51
 [testenv:docs]
52
+basepython = python3
51 53
 deps = -r{toxinidir}/doc/requirements.txt
52 54
 commands = sphinx-build -W -b html doc/source doc/build/html
53 55
 
54 56
 [testenv:pep8]
57
+basepython = python3
55 58
 deps = hacking<0.13,>=0.12
56 59
       doc8
57 60
 commands =
@@ -63,5 +66,6 @@ exclude=.venv,.git,.tox,dist,*egg,*.egg-info,build,examples,doc
63 66
 show-source = True
64 67
 
65 68
 [testenv:releasenotes]
69
+basepython = python3
66 70
 deps = -r{toxinidir}/doc/requirements.txt
67 71
 commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

Loading…
Cancel
Save