Browse Source

Migrate to flake8.

Fixes bug 1172444.

Change-Id: I0d8faa0819738456a28aaf5cc859f510a2b3ed68
Monty Taylor 6 years ago
parent
commit
9d4db6f740
3 changed files with 14 additions and 12 deletions
  1. 2
    7
      run_tests.sh
  2. 6
    1
      tools/test-requires
  3. 6
    4
      tox.ini

+ 2
- 7
run_tests.sh View File

@@ -102,13 +102,8 @@ function copy_subunit_log {
102 102
 }
103 103
 
104 104
 function run_pep8 {
105
-  echo "Running pep8 ..."
106
-  srcfiles="--exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*"
107
-  srcfiles+=",*egg,build ."
108
-  # Just run PEP8 in current environment
109
-  #
110
-  ignore="--ignore=E12,E711,E721,E712"
111
-  ${wrapper} pep8 ${ignore} --show-source ${srcfiles}
105
+  echo "Running flake8 ..."
106
+  ${wrapper} flake8
112 107
 }
113 108
 
114 109
 TESTRTESTS="testr run --parallel $testropts"

+ 6
- 1
tools/test-requires View File

@@ -1,11 +1,16 @@
1 1
 distribute>=0.6.24
2 2
 
3
+# Install bounded pep8/pyflakes first, then let flake8 install
4
+pep8==1.4.5
5
+pyflakes==0.7.2
6
+flake8==2.0
7
+hacking>=0.5.3,<0.6
8
+
3 9
 coverage
4 10
 discover
5 11
 fixtures>=0.3.12
6 12
 keyring
7 13
 mock
8
-pep8==1.3.3
9 14
 sphinx>=1.1.2
10 15
 testrepository>=0.0.13
11 16
 testtools>=0.9.26

+ 6
- 4
tox.ini View File

@@ -12,10 +12,7 @@ deps = -r{toxinidir}/tools/pip-requires
12 12
 commands = python setup.py testr --testr-args='{posargs}'
13 13
 
14 14
 [testenv:pep8]
15
-deps = pep8==1.3.3
16
-commands =
17
-  pep8 --ignore=E12,E711,E721,E712 --show-source \
18
-    --exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build .
15
+commands = flake8
19 16
 
20 17
 [testenv:venv]
21 18
 commands = {posargs}
@@ -25,3 +22,8 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
25 22
 
26 23
 [tox:jenkins]
27 24
 downloadcache = ~/cache/pip
25
+
26
+[flake8]
27
+ignore = E12,E711,E721,E712,F,H
28
+show-source = True
29
+exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build

Loading…
Cancel
Save