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: I5ed6fb582e14853e8908c3fb82d5061591ac7bbf
changes/42/573542/2
huang.zhiping 1 year ago
parent
commit
a6356e7fba
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      tox.ini

+ 7
- 2
tox.ini View File

@@ -1,10 +1,9 @@
1 1
 [tox]
2
-envlist = py27,pep8
2
+envlist = py27,py35,pep8
3 3
 minversion = 1.6
4 4
 skipsdist = True
5 5
 
6 6
 [testenv]
7
-basepython=python2.7
8 7
 usedevelop = True
9 8
 install_command = pip install -U {opts} {packages}
10 9
 setenv = VIRTUAL_ENV={envdir}
@@ -21,12 +20,14 @@ commands =
21 20
   {envpython} {toxinidir}/manage.py test apmec_horizon --settings=apmec_horizon.test.settings {posargs}
22 21
 
23 22
 [testenv:py27]
23
+basepython=python2.7
24 24
 commands =
25 25
   {envpython} {toxinidir}/manage.py test apmec_horizon --settings=apmec_horizon.test.settings {posargs}
26 26
 
27 27
 [tox:jenkins]
28 28
 
29 29
 [testenv:pep8]
30
+basepython=python3
30 31
 usedevelop = True
31 32
 whitelist_externals =
32 33
   git
@@ -37,13 +38,16 @@ commands =
37 38
   flake8
38 39
 
39 40
 [testenv:doc]
41
+basepython=python3
40 42
 deps = Sphinx
41 43
 commands = sphinx-build doc/source doc/build
42 44
 
43 45
 [testenv:cover]
46
+basepython=python3
44 47
 setenv = NOSE_WITH_COVERAGE=1
45 48
 
46 49
 [testenv:venv]
50
+basepython=python3
47 51
 commands = {posargs}
48 52
 
49 53
 [flake8]
@@ -51,6 +55,7 @@ show-source = True
51 55
 max-complexity = 20
52 56
 
53 57
 [testenv:makemessages]
58
+basepython=python3
54 59
 commands =
55 60
     pybabel extract -F babel-django.cfg -o apmec_horizon/locale/django.pot -k gettext_noop -k gettext_lazy -k ngettext_lazy:1,2 -k ugettext_noop -k ugettext_lazy -k ungettext_lazy:1,2 -k npgettext:1c,2,3 -k pgettext_lazy:1c,2 -k npgettext_lazy:1c,2,3 apmec_horizon
56 61
     pybabel extract -F babel-djangojs.cfg -o apmec_horizon/locale/djangojs.pot -k gettext_noop -k gettext_lazy -k ngettext_lazy:1,2 -k ugettext_noop -k ugettext_lazy -k ungettext_lazy:1,2 -k npgettext:1c,2,3 -k pgettext_lazy:1c,2 -k npgettext_lazy:1c,2,3 apmec_horizon

Loading…
Cancel
Save