Migrate to flake8.
Fixes bug 1172444. Change-Id: Ia063ec67de9e6061ce38b948c9eb60b5589c7bb4
This commit is contained in:
22
run_tests.sh
22
run_tests.sh
@@ -117,26 +117,8 @@ function copy_subunit_log {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function run_pep8 {
|
function run_pep8 {
|
||||||
echo "Running pep8 ..."
|
echo "Running flake8 ..."
|
||||||
srcfiles="cinderclient tests"
|
${wrapper} flake8
|
||||||
# Just run PEP8 in current environment
|
|
||||||
#
|
|
||||||
# NOTE(sirp): W602 (deprecated 3-arg raise) is being ignored for the
|
|
||||||
# following reasons:
|
|
||||||
#
|
|
||||||
# 1. It's needed to preserve traceback information when re-raising
|
|
||||||
# exceptions; this is needed b/c Eventlet will clear exceptions when
|
|
||||||
# switching contexts.
|
|
||||||
#
|
|
||||||
# 2. There doesn't appear to be an alternative, "pep8-tool" compatible way of doing this
|
|
||||||
# in Python 2 (in Python 3 `with_traceback` could be used).
|
|
||||||
#
|
|
||||||
# 3. Can find no corroborating evidence that this is deprecated in Python 2
|
|
||||||
# other than what the PEP8 tool claims. It is deprecated in Python 3, so,
|
|
||||||
# perhaps the mistake was thinking that the deprecation applied to Python 2
|
|
||||||
# as well.
|
|
||||||
pep8_opts="--ignore=E202,W602 --repeat"
|
|
||||||
${wrapper} pep8 ${pep8_opts} ${srcfiles}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TESTRTESTS="testr run --parallel $testropts"
|
TESTRTESTS="testr run --parallel $testropts"
|
||||||
|
@@ -1,10 +1,15 @@
|
|||||||
distribute>=0.6.24
|
distribute>=0.6.24
|
||||||
|
|
||||||
|
# Install bounded pep8/pyflakes first, then let flake8 install
|
||||||
|
pep8==1.4.5
|
||||||
|
pyflakes==0.7.2
|
||||||
|
flake8==2.0
|
||||||
|
hacking>=0.5.3,<0.6
|
||||||
|
|
||||||
coverage
|
coverage
|
||||||
discover
|
discover
|
||||||
fixtures
|
fixtures
|
||||||
mock
|
mock
|
||||||
pep8==1.3.3
|
|
||||||
sphinx>=1.1.2
|
sphinx>=1.1.2
|
||||||
testrepository>=0.0.13
|
testrepository>=0.0.13
|
||||||
testtools>=0.9.22
|
testtools>=0.9.22
|
||||||
|
8
tox.ini
8
tox.ini
@@ -12,8 +12,7 @@ deps = -r{toxinidir}/tools/pip-requires
|
|||||||
commands = python setup.py testr --testr-args='{posargs}'
|
commands = python setup.py testr --testr-args='{posargs}'
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
deps = pep8
|
commands = flake8
|
||||||
commands = pep8 --repeat --show-source cinderclient setup.py
|
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
@@ -23,3 +22,8 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
|
|||||||
|
|
||||||
[tox:jenkins]
|
[tox:jenkins]
|
||||||
downloadcache = ~/cache/pip
|
downloadcache = ~/cache/pip
|
||||||
|
|
||||||
|
[flake8]
|
||||||
|
show-source = True
|
||||||
|
ignore = F,H
|
||||||
|
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools
|
||||||
|
Reference in New Issue
Block a user