updating PEP8 to 1.3.3
* matching cinder, glance, etc * made run_tests exclusions match tox Change-Id: I9963245b079535a38a8c9b46917e8d833b62addb
This commit is contained in:
23
run_tests.sh
23
run_tests.sh
@@ -78,27 +78,10 @@ function run_pep8 {
|
|||||||
srcfiles="keystoneclient tests"
|
srcfiles="keystoneclient tests"
|
||||||
# Just run PEP8 in current environment
|
# Just run PEP8 in current environment
|
||||||
#
|
#
|
||||||
# NOTE(sirp): W602 (deprecated 3-arg raise) is being ignored for the
|
# NOTE(heckj): E125, E126 are being ignored matching other openstack projects
|
||||||
# following reasons:
|
# for pep 1.3.3 due to relatively arbitrary line indentation rulings
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
# NOTE(henry-nash): Added exlusion of the openstack.common dir (as
|
|
||||||
# is the case in other projects, since some of the common files
|
|
||||||
# don't pass pep8. Clearly we should come back a fix this
|
|
||||||
#
|
|
||||||
${wrapper} pep8 --repeat --show-pep8 --show-source \
|
${wrapper} pep8 --repeat --show-pep8 --show-source \
|
||||||
--ignore=E202,W602 --exclude=openstack \
|
--ignore=E125,E126 --exclude=.venv,.tox,dist,doc \
|
||||||
${srcfiles}
|
${srcfiles}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -252,7 +252,8 @@ def print_help():
|
|||||||
def parse_args():
|
def parse_args():
|
||||||
"""Parse command-line arguments"""
|
"""Parse command-line arguments"""
|
||||||
parser = optparse.OptionParser()
|
parser = optparse.OptionParser()
|
||||||
parser.add_option("-n", "--no-site-packages", dest="no_site_packages",
|
parser.add_option(
|
||||||
|
"-n", "--no-site-packages", dest="no_site_packages",
|
||||||
default=False, action="store_true",
|
default=False, action="store_true",
|
||||||
help="Do not inherit packages from global Python install")
|
help="Do not inherit packages from global Python install")
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
@@ -7,7 +7,7 @@ nose
|
|||||||
nose-exclude
|
nose-exclude
|
||||||
openstack.nose_plugin
|
openstack.nose_plugin
|
||||||
nosehtmloutput
|
nosehtmloutput
|
||||||
pep8==1.2
|
pep8==1.3.3
|
||||||
sphinx>=1.1.2
|
sphinx>=1.1.2
|
||||||
unittest2>=0.5.1
|
unittest2>=0.5.1
|
||||||
WebOb==1.0.8
|
WebOb==1.0.8
|
||||||
|
2
tox.ini
2
tox.ini
@@ -17,7 +17,7 @@ commands = nosetests {posargs}
|
|||||||
downloadcache = ~/cache/pip
|
downloadcache = ~/cache/pip
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
commands = pep8 --repeat --show-source --exclude=.venv,.tox,dist,doc .
|
commands = pep8 --repeat --show-source --ignore=E711,E712,E125,E126 --exclude=.venv,.tox,dist,doc .
|
||||||
|
|
||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
setenv = NOSE_WITH_COVERAGE=1
|
setenv = NOSE_WITH_COVERAGE=1
|
||||||
|
Reference in New Issue
Block a user