updating PEP8 to 1.3.3

* matching cinder, glance, etc
* made run_tests exclusions match tox

Change-Id: I9963245b079535a38a8c9b46917e8d833b62addb
This commit is contained in:
Joe Heck
2012-11-21 21:48:12 +00:00
committed by Dolph Mathews
parent e4ed1f39a0
commit f9649e2615
4 changed files with 9 additions and 25 deletions

View File

@@ -78,27 +78,10 @@ function run_pep8 {
srcfiles="keystoneclient tests"
# 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.
#
# 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
#
# NOTE(heckj): E125, E126 are being ignored matching other openstack projects
# for pep 1.3.3 due to relatively arbitrary line indentation rulings
${wrapper} pep8 --repeat --show-pep8 --show-source \
--ignore=E202,W602 --exclude=openstack \
--ignore=E125,E126 --exclude=.venv,.tox,dist,doc \
${srcfiles}
}

View File

@@ -169,7 +169,7 @@ class Suse(Distro):
def get_distro():
if (os.path.exists('/etc/fedora-release') or
os.path.exists('/etc/redhat-release')):
os.path.exists('/etc/redhat-release')):
return Fedora()
elif os.path.exists('/etc/SuSE-release'):
return Suse()
@@ -218,7 +218,7 @@ def install_dependencies(venv=VENV):
# Tell the virtual env how to "import nova"
pthfile = os.path.join(venv, "lib", PY_VERSION, "site-packages",
"keystoneclient.pth")
"keystoneclient.pth")
f = open(pthfile, 'w')
f.write("%s\n" % ROOT)
@@ -252,7 +252,8 @@ def print_help():
def parse_args():
"""Parse command-line arguments"""
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",
help="Do not inherit packages from global Python install")
return parser.parse_args()

View File

@@ -7,7 +7,7 @@ nose
nose-exclude
openstack.nose_plugin
nosehtmloutput
pep8==1.2
pep8==1.3.3
sphinx>=1.1.2
unittest2>=0.5.1
WebOb==1.0.8

View File

@@ -17,7 +17,7 @@ commands = nosetests {posargs}
downloadcache = ~/cache/pip
[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]
setenv = NOSE_WITH_COVERAGE=1