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.

Change-Id: Ifb095a3cbad9d554a155d8ebfc2d5a5bf97e35e6
Closes-Bug:  #1801671
huang.zhiping 5 months ago
parent
commit
203c2d0270
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      tox.ini

+ 8
- 0
tox.ini View File

@@ -24,6 +24,7 @@ commands =
24 24
   {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envbindir}
25 25
 
26 26
 [testenv:hashtest]
27
+basepython = python3
27 28
 # This is the same as default environment, but with a random PYTHONHASHSEED.
28 29
 # You can also specify a specific hashseed (for test repeatability) as follows:
29 30
 #   tox --hashseed 1235130571 -e hashtest
@@ -33,12 +34,14 @@ setenv = VIRTUAL_ENV={envdir}
33 34
 sitepackages = True
34 35
 
35 36
 [testenv:pep8]
37
+basepython = python3
36 38
 commands =
37 39
   # If it is easier to add a check via a shell script, consider adding it in this file
38 40
   flake8
39 41
 whitelist_externals = sh
40 42
 
41 43
 [testenv:cover]
44
+basepython = python3
42 45
 setenv =
43 46
     {[testenv]setenv}
44 47
     PYTHON=coverage run --source openstack --parallel-mode
@@ -49,9 +52,11 @@ commands =
49 52
     coverage xml -o cover/coverage.xml
50 53
 
51 54
 [testenv:venv]
55
+basepython = python3
52 56
 commands = {posargs}
53 57
 
54 58
 [testenv:docs]
59
+basepython = python3
55 60
 commands = sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html
56 61
 
57 62
 [flake8]
@@ -70,6 +75,7 @@ builtins = _
70 75
 exclude = ./.*,build,dist,networking_bigswitch/openstack/common/*
71 76
 
72 77
 [testenv:pylint]
78
+basepython = python3
73 79
 deps =
74 80
   {[testenv]deps}
75 81
   pylint
@@ -81,6 +87,7 @@ import_exceptions = neutron._i18n
81 87
 local-check-factory = neutron_lib.hacking.checks.factory
82 88
 
83 89
 [testenv:dev]
90
+basepython = python3
84 91
 # run locally (not in the gate) using editable mode
85 92
 # https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs
86 93
 commands =
@@ -94,6 +101,7 @@ commands =
94 101
     {[testenv]commands}
95 102
 
96 103
 [testenv:pep8-dev]
104
+basepython = python3
97 105
 commands =
98 106
     {[testenv:dev]commands}
99 107
     {[testenv:pep8]commands}

Loading…
Cancel
Save