Browse Source

Use python3 for tox linting

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.

Also, add tox-linters job to gate so that changes like this can merge.
The files section limit what runs - and if *nothing* run, there's no +2
from CI. Another reason to add this job is that we run voting jobs in
both check and gate, and this one was only in check.

Change-Id: I742695bfcd071c4930c4170553af7d9a59f6a432
changes/87/588587/4
Sorin Sbarnea 10 months ago
parent
commit
db10400e88
2 changed files with 6 additions and 1 deletions
  1. 2
    0
      tox.ini
  2. 4
    1
      zuul.d/layout.yaml

+ 2
- 0
tox.ini View File

@@ -11,10 +11,12 @@ deps = -r{toxinidir}/test-requirements.txt
11 11
 commands = {posargs}
12 12
 
13 13
 [testenv:pyflakes]
14
+basepython = python3
14 15
 deps = pyflakes
15 16
 commands = pyflakes setup.py scripts
16 17
 
17 18
 [testenv:linters]
19
+basepython = python3
18 20
 whitelist_externals = bash
19 21
 commands = flake8 --max-line-length 80 {toxinidir} {posargs}
20 22
 

+ 4
- 1
zuul.d/layout.yaml View File

@@ -13,13 +13,13 @@
13 13
       - tripleo-multinode-branchful
14 14
     check:
15 15
       jobs:
16
+        - openstack-tox-linters
16 17
         - openstack-tox-py27:
17 18
             files:
18 19
               - ^scripts/emit_releases_file/.*$
19 20
         - openstack-tox-py35:
20 21
             files:
21 22
               - ^scripts/emit_releases_file/.*$
22
-        - openstack-tox-linters
23 23
         - tripleo-ci-centos-7-scenario001-multinode-oooq:
24 24
             files:
25 25
               - ^playbooks/tripleo-ci/.*$
@@ -62,6 +62,9 @@
62 62
     gate:
63 63
       queue: tripleo
64 64
       jobs:
65
+          # Don't put a files section on the linters job, otherwise no
66
+          # jobs might be defined and nothing can merge in this repo.
67
+        - openstack-tox-linters
65 68
         - openstack-tox-py27:
66 69
             files:
67 70
               - ^scripts/emit_releases_file/.*$

Loading…
Cancel
Save