summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGinnis <sean.mcginnis@gmail.com>2018-06-13 16:51:32 -0500
committerSean McGinnis <sean.mcginnis@gmail.com>2018-06-13 16:54:35 -0500
commit5542de51bc2205ee297fb94539ff5ab4d0b73109 (patch)
treede4683371560fc8ae7a72d04e07438631243f14c
parentb229a9adedc58c6a745e51f088aca2e18e1193cc (diff)
Be explicit about tox python version
We want to default all jobs to use python 3 except for the ones that use explicit versions. Unfortunately, the current tox behavior for setting basepython to python3 is not intuitive. If the system default is python 3.5, then when basepython is set to python3, both the py35 and py36 targets will end up running with python 3.5. To get around this we need to not set a default base version and explicitly set each testenv to python3 that we want to run using 3 instead of 2 but do not really care which minor version is used. Change-Id: I3971eeafbd1e732a584b0c52d2eb6c2175b709aa
Notes
Notes (review): Code-Review+2: Jay Bryant <jungleboyj@electronicjungle.net> Workflow+1: Jay Bryant <jungleboyj@electronicjungle.net> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 14 Jun 2018 15:45:01 +0000 Reviewed-on: https://review.openstack.org/575247 Project: openstack/cinder Branch: refs/heads/master
-rw-r--r--tox.ini18
1 files changed, 17 insertions, 1 deletions
diff --git a/tox.ini b/tox.ini
index fce211f..f04e4ae 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,7 +4,6 @@ skipsdist = True
4envlist = py35,py27,compliance,pep8 4envlist = py35,py27,compliance,pep8
5 5
6[testenv] 6[testenv]
7basepython = python3
8setenv = VIRTUAL_ENV={envdir} 7setenv = VIRTUAL_ENV={envdir}
9 PYTHONWARNINGS=default::DeprecationWarning 8 PYTHONWARNINGS=default::DeprecationWarning
10 OS_STDOUT_CAPTURE=1 9 OS_STDOUT_CAPTURE=1
@@ -31,6 +30,7 @@ whitelist_externals =
31passenv = *_proxy *_PROXY 30passenv = *_proxy *_PROXY
32 31
33[testenv:api-ref] 32[testenv:api-ref]
33basepython = python3
34whitelist_externals = rm 34whitelist_externals = rm
35deps = 35deps =
36 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} 36 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
@@ -40,6 +40,7 @@ commands =
40 sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html/ 40 sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html/
41 41
42[testenv:releasenotes] 42[testenv:releasenotes]
43basepython = python3
43deps = 44deps =
44 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} 45 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
45 -r{toxinidir}/requirements.txt 46 -r{toxinidir}/requirements.txt
@@ -61,10 +62,12 @@ setenv =
61 {[testenv:functional]setenv} 62 {[testenv:functional]setenv}
62 63
63[testenv:compliance] 64[testenv:compliance]
65basepython = python3
64setenv = 66setenv =
65 OS_TEST_PATH = ./cinder/tests/compliance 67 OS_TEST_PATH = ./cinder/tests/compliance
66 68
67[testenv:pep8] 69[testenv:pep8]
70basepython = python3
68commands = 71commands =
69 python setup.py check --restructuredtext --strict 72 python setup.py check --restructuredtext --strict
70 flake8 {posargs} . 73 flake8 {posargs} .
@@ -72,12 +75,14 @@ commands =
72 {toxinidir}/tools/check_exec.py {toxinidir}/cinder {toxinidir}/doc/source/ {toxinidir}/releasenotes/notes 75 {toxinidir}/tools/check_exec.py {toxinidir}/cinder {toxinidir}/doc/source/ {toxinidir}/releasenotes/notes
73 76
74[testenv:fast8] 77[testenv:fast8]
78basepython = python3
75# Use same environment directory as pep8 env to save space and install time 79# Use same environment directory as pep8 env to save space and install time
76envdir = {toxworkdir}/pep8 80envdir = {toxworkdir}/pep8
77commands = 81commands =
78 {toxinidir}/tools/fast8.sh 82 {toxinidir}/tools/fast8.sh
79 83
80[testenv:pylint] 84[testenv:pylint]
85basepython = python3
81deps = -r{toxinidir}/requirements.txt 86deps = -r{toxinidir}/requirements.txt
82 pylint==1.9.1 87 pylint==1.9.1
83commands = bash tools/lintstack.sh 88commands = bash tools/lintstack.sh
@@ -85,6 +90,7 @@ commands = bash tools/lintstack.sh
85[testenv:cover] 90[testenv:cover]
86# Also do not run test_coverage_ext tests while gathering coverage as those 91# Also do not run test_coverage_ext tests while gathering coverage as those
87# tests conflict with coverage. 92# tests conflict with coverage.
93basepython = python3
88setenv = 94setenv =
89 {[testenv]setenv} 95 {[testenv]setenv}
90 PYTHON=coverage run --source cinder --parallel-mode 96 PYTHON=coverage run --source cinder --parallel-mode
@@ -95,23 +101,28 @@ commands =
95 coverage xml -o cover/coverage.xml 101 coverage xml -o cover/coverage.xml
96 102
97[testenv:genconfig] 103[testenv:genconfig]
104basepython = python3
98sitepackages = False 105sitepackages = False
99envdir = {toxworkdir}/pep8 106envdir = {toxworkdir}/pep8
100commands = oslo-config-generator --config-file=tools/config/cinder-config-generator.conf 107commands = oslo-config-generator --config-file=tools/config/cinder-config-generator.conf
101 108
102 109
103[testenv:genpolicy] 110[testenv:genpolicy]
111basepython = python3
104commands = oslopolicy-sample-generator --config-file=tools/config/cinder-policy-generator.conf 112commands = oslopolicy-sample-generator --config-file=tools/config/cinder-policy-generator.conf
105 113
106[testenv:genopts] 114[testenv:genopts]
115basepython = python3
107sitepackages = False 116sitepackages = False
108envdir = {toxworkdir}/pep8 117envdir = {toxworkdir}/pep8
109commands = python tools/config/generate_cinder_opts.py 118commands = python tools/config/generate_cinder_opts.py
110 119
111[testenv:venv] 120[testenv:venv]
121basepython = python3
112commands = {posargs} 122commands = {posargs}
113 123
114[testenv:docs] 124[testenv:docs]
125basepython = python3
115deps = 126deps =
116 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} 127 -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
117 -r{toxinidir}/requirements.txt 128 -r{toxinidir}/requirements.txt
@@ -125,15 +136,18 @@ commands =
125whitelist_externals = rm 136whitelist_externals = rm
126 137
127[testenv:gendriverlist] 138[testenv:gendriverlist]
139basepython = python3
128sitepackages = False 140sitepackages = False
129envdir = {toxworkdir}/venv 141envdir = {toxworkdir}/venv
130commands = python {toxinidir}/tools/generate_driver_list.py 142commands = python {toxinidir}/tools/generate_driver_list.py
131 143
132[testenv:bandit] 144[testenv:bandit]
145basepython = python3
133deps = -r{toxinidir}/test-requirements.txt 146deps = -r{toxinidir}/test-requirements.txt
134commands = bandit -r cinder -n5 -x tests -ll 147commands = bandit -r cinder -n5 -x tests -ll
135 148
136[testenv:bandit-baseline] 149[testenv:bandit-baseline]
150basepython = python3
137envdir = {toxworkdir}/bandit 151envdir = {toxworkdir}/bandit
138commands = bandit-baseline -r cinder -n5 -x tests -ii -ll 152commands = bandit-baseline -r cinder -n5 -x tests -ii -ll
139 153
@@ -144,6 +158,7 @@ commands = bandit-baseline -r cinder -n5 -x tests -ii -ll
144# separately, outside of the requirements files, and develop mode disabled 158# separately, outside of the requirements files, and develop mode disabled
145# explicitly to avoid unnecessarily installing the checked-out repo too (this 159# explicitly to avoid unnecessarily installing the checked-out repo too (this
146# further relies on "tox.skipsdist = True" above). 160# further relies on "tox.skipsdist = True" above).
161basepython = python3
147deps = bindep 162deps = bindep
148commands = bindep test 163commands = bindep test
149usedevelop = False 164usedevelop = False
@@ -164,6 +179,7 @@ local-check-factory = cinder.hacking.checks.factory
164import_exceptions = cinder.i18n 179import_exceptions = cinder.i18n
165 180
166[testenv:lower-constraints] 181[testenv:lower-constraints]
182basepython = python3
167deps = 183deps =
168 -c{toxinidir}/lower-constraints.txt 184 -c{toxinidir}/lower-constraints.txt
169 -r{toxinidir}/test-requirements.txt 185 -r{toxinidir}/test-requirements.txt