Enable pep8 check

This commit is contained in:
Julien Schueller 2014-06-07 13:10:27 +02:00
commit 7a4cef998c
4 changed files with 22 additions and 12 deletions

View file

@ -10,6 +10,7 @@ endif
LANGUAGE = python
PYTHON = $(PYBIN)
PEP8 = @PEP8@
#*_runme.py for Python 2.x, *_runme3.py for Python 3.x
PY2SCRIPTSUFFIX = _runme.py
@ -111,12 +112,14 @@ VALGRIND_OPT += --suppressions=pythonswig.supp
+$(convert_testcase)
$(setup)
+$(swig_and_compile_cpp)
$(check_pep8)
$(run_testcase)
%.ctest:
+$(convert_testcase)
$(setup)
+$(swig_and_compile_c)
$(check_pep8)
$(run_testcase)
%.multicpptest:
@ -126,6 +129,7 @@ VALGRIND_OPT += --suppressions=pythonswig.supp
$(run_testcase)
# Runs the testcase. A testcase is only run if
# a file is found which has _runme.py (or _runme3.py for Python 3) appended after the testcase name.
@ -133,6 +137,11 @@ py_runme = $(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)
py2_runme = $(SCRIPTPREFIX)$*$(PY2SCRIPTSUFFIX)
py3_runme = $(SCRIPTPREFIX)$*$(PY3SCRIPTSUFFIX)
check_pep8 = \
if [ -n "$(PEP8)" ]; then \
$(PEP8) --ignore=E501,E30,W291,W391 `echo $(py2_runme)|sed "s|_runme||g"`;\
fi
run_python = env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PYTHONPATH=.:$(srcdir):$$PYTHONPATH $(RUNTOOL) $(PYTHON) $(py_runme)
run_testcase = \

View file

@ -5,22 +5,22 @@ Testcase to test %pythonprepend and %pythonappend %pythoncode %pythonbegin
%module python_append
%pythoncode %{
mypath = os.path.dirname("/a/b/c/d.txt")
funcpath = None
staticfuncpath = None
def grabpath():
mypath = os.path.dirname("/a/b/c/d.txt")
funcpath = None
staticfuncpath = None
def grabpath():
return funcpath
def grabstaticpath():
def grabstaticpath():
return staticfuncpath
%}
%pythonappend Test::func %{
funcpath = os.path.dirname(funcpath)
funcpath = os.path.dirname(funcpath)
%}
%pythonprepend Test::func %{
global funcpath
funcpath = mypath
global funcpath
funcpath = mypath
%}
%pythonappend Test::static_func %{
@ -29,9 +29,9 @@ pass
%}
%pythonprepend Test::static_func {
global staticfuncpath
staticfuncpath = mypath
pass
global staticfuncpath
staticfuncpath = mypath
pass
}
%pythonbegin %{