Merge "updating PEP8 to 1.3.3"
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}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -169,7 +169,7 @@ class Suse(Distro):
|
|||||||
|
|
||||||
def get_distro():
|
def get_distro():
|
||||||
if (os.path.exists('/etc/fedora-release') or
|
if (os.path.exists('/etc/fedora-release') or
|
||||||
os.path.exists('/etc/redhat-release')):
|
os.path.exists('/etc/redhat-release')):
|
||||||
return Fedora()
|
return Fedora()
|
||||||
elif os.path.exists('/etc/SuSE-release'):
|
elif os.path.exists('/etc/SuSE-release'):
|
||||||
return Suse()
|
return Suse()
|
||||||
@@ -218,7 +218,7 @@ def install_dependencies(venv=VENV):
|
|||||||
|
|
||||||
# Tell the virtual env how to "import nova"
|
# Tell the virtual env how to "import nova"
|
||||||
pthfile = os.path.join(venv, "lib", PY_VERSION, "site-packages",
|
pthfile = os.path.join(venv, "lib", PY_VERSION, "site-packages",
|
||||||
"keystoneclient.pth")
|
"keystoneclient.pth")
|
||||||
f = open(pthfile, 'w')
|
f = open(pthfile, 'w')
|
||||||
f.write("%s\n" % ROOT)
|
f.write("%s\n" % ROOT)
|
||||||
|
|
||||||
@@ -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