Migrate to flake8.

Fixes bug 1172444

Change-Id: I09e1e2d03f41a175aa39760b5fc560ed0d9d30a5
This commit is contained in:
Monty Taylor 2013-05-16 10:07:14 -07:00
parent 9037e6f3df
commit 98d42e50e3
5 changed files with 19 additions and 18 deletions

View File

@ -117,7 +117,8 @@ if __name__ == "__main__":
app = initialize_reddwarf(config_file)
# Initialize sqlite database.
initialize_database()
# Swap out WSGI, httplib, and several sleep functions with test doubles.
# Swap out WSGI, httplib, and several sleep functions
# with test doubles.
initialize_fakes(app)
# Initialize the test configuration.
test_config_file = parse_args_for_test_config()

View File

@ -81,13 +81,6 @@ function run_tests {
function run_pep8 {
echo "Running pep8 ..."
# Opt-out files from pep8
ignore_scripts="*.sh:*reddwarf-debug:*clean-vlans"
ignore_files="*eventlet-patch:*pip-requires:*test-requires"
GLOBIGNORE="$ignore_scripts:$ignore_files"
srcfiles=`find bin -type f ! -name "reddwarf.conf*"`
srcfiles+=" `find tools/*`"
srcfiles+=" setup.py bin reddwarf"
# Just run PEP8 in current environment
#
# NOTE(sirp): W602 (deprecated 3-arg raise) is being ignored for the
@ -104,9 +97,7 @@ function run_pep8 {
# 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.
${wrapper} pep8 --repeat --show-pep8 --show-source \
--ignore=E202,W602 \
--exclude=vcsversion.py ${srcfiles}
${wrapper} flake8
}
NOSETESTS="python run_tests.py $noseopts $noseargs"

View File

@ -27,7 +27,8 @@ requires = setup.parse_requirements()
depend_links = setup.parse_dependency_links()
setuptools.setup(name='reddwarf',
setuptools.setup(
name='reddwarf',
version=setup.get_version('reddwarf'),
description='DBaaS services for Openstack',
author='OpenStack',
@ -46,7 +47,7 @@ setuptools.setup(name='reddwarf',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.6',
'Environment :: No Input/Output (Daemon)',
],
],
scripts=['bin/reddwarf-api',
'bin/reddwarf-server',
'bin/reddwarf-taskmanager',

View File

@ -1,12 +1,16 @@
# Packages needed for dev testing
distribute>=0.6.28
# 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
nose
nosexcover
openstack.nose_plugin
pep8==1.3.3
pylint
webtest
wsgi_intercept
proboscis==1.2.5.3

10
tox.ini
View File

@ -15,9 +15,7 @@ sitepackages = True
downloadcache = ~/cache/pip
[testenv:pep8]
deps = pep8
setuptools_git>=0.4
commands = pep8 --repeat --show-source --ignore=E125 --exclude=.venv,.tox,dist,doc,openstack,*egg reddwarf
commands = flake8
[testenv:cover]
basepython = python2.7
@ -32,3 +30,9 @@ commands =
[testenv:venv]
commands = {posargs}
[flake8]
show-source = True
ignore = E125,F401,F403,F811,F821,F841,H
builtins = _
exclude=.venv,.tox,dist,doc,openstack,*egg,rsdns,tools