Enable pep8 check
This commit is contained in:
parent
6fe71da9fa
commit
7a4cef998c
4 changed files with 22 additions and 12 deletions
|
|
@ -64,6 +64,7 @@ before_install:
|
||||||
- if test "$SWIGLANG" = "lua"; then sudo apt-get -qq install lua5.1 liblua5.1-dev; fi
|
- if test "$SWIGLANG" = "lua"; then sudo apt-get -qq install lua5.1 liblua5.1-dev; fi
|
||||||
- if test "$SWIGLANG" = "octave"; then sudo apt-get -qq install octave3.2 octave3.2-headers; fi
|
- if test "$SWIGLANG" = "octave"; then sudo apt-get -qq install octave3.2 octave3.2-headers; fi
|
||||||
- if test "$SWIGLANG" = "php"; then sudo apt-get install php5-cli php5-dev; fi
|
- if test "$SWIGLANG" = "php"; then sudo apt-get install php5-cli php5-dev; fi
|
||||||
|
- if test "$SWIGLANG" = "python"; then sudo apt-get install -qq pep8; fi
|
||||||
- if test "$SWIGLANG" = "python" -a "$PY3" -a -z "$VER"; then sudo apt-get install -qq python3-dev; fi
|
- if test "$SWIGLANG" = "python" -a "$PY3" -a -z "$VER"; then sudo apt-get install -qq python3-dev; fi
|
||||||
- if test "$SWIGLANG" = "python" -a "$VER"; then sudo add-apt-repository -y ppa:fkrull/deadsnakes && sudo apt-get -qq update && sudo apt-get -qq install python${VER}-dev && export CONFIGOPTS="--with-python${PY3}=python${VER}"; fi
|
- if test "$SWIGLANG" = "python" -a "$VER"; then sudo add-apt-repository -y ppa:fkrull/deadsnakes && sudo apt-get -qq update && sudo apt-get -qq install python${VER}-dev && export CONFIGOPTS="--with-python${PY3}=python${VER}"; fi
|
||||||
- if test "$SWIGLANG" = "tcl"; then sudo apt-get -qq install tcl8.4-dev; fi
|
- if test "$SWIGLANG" = "tcl"; then sudo apt-get -qq install tcl8.4-dev; fi
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ endif
|
||||||
|
|
||||||
LANGUAGE = python
|
LANGUAGE = python
|
||||||
PYTHON = $(PYBIN)
|
PYTHON = $(PYBIN)
|
||||||
|
PEP8 = @PEP8@
|
||||||
|
|
||||||
#*_runme.py for Python 2.x, *_runme3.py for Python 3.x
|
#*_runme.py for Python 2.x, *_runme3.py for Python 3.x
|
||||||
PY2SCRIPTSUFFIX = _runme.py
|
PY2SCRIPTSUFFIX = _runme.py
|
||||||
|
|
@ -111,12 +112,14 @@ VALGRIND_OPT += --suppressions=pythonswig.supp
|
||||||
+$(convert_testcase)
|
+$(convert_testcase)
|
||||||
$(setup)
|
$(setup)
|
||||||
+$(swig_and_compile_cpp)
|
+$(swig_and_compile_cpp)
|
||||||
|
$(check_pep8)
|
||||||
$(run_testcase)
|
$(run_testcase)
|
||||||
|
|
||||||
%.ctest:
|
%.ctest:
|
||||||
+$(convert_testcase)
|
+$(convert_testcase)
|
||||||
$(setup)
|
$(setup)
|
||||||
+$(swig_and_compile_c)
|
+$(swig_and_compile_c)
|
||||||
|
$(check_pep8)
|
||||||
$(run_testcase)
|
$(run_testcase)
|
||||||
|
|
||||||
%.multicpptest:
|
%.multicpptest:
|
||||||
|
|
@ -126,6 +129,7 @@ VALGRIND_OPT += --suppressions=pythonswig.supp
|
||||||
$(run_testcase)
|
$(run_testcase)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Runs the testcase. A testcase is only run if
|
# 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.
|
# 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)
|
py2_runme = $(SCRIPTPREFIX)$*$(PY2SCRIPTSUFFIX)
|
||||||
py3_runme = $(SCRIPTPREFIX)$*$(PY3SCRIPTSUFFIX)
|
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_python = env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PYTHONPATH=.:$(srcdir):$$PYTHONPATH $(RUNTOOL) $(PYTHON) $(py_runme)
|
||||||
|
|
||||||
run_testcase = \
|
run_testcase = \
|
||||||
|
|
|
||||||
|
|
@ -5,22 +5,22 @@ Testcase to test %pythonprepend and %pythonappend %pythoncode %pythonbegin
|
||||||
%module python_append
|
%module python_append
|
||||||
|
|
||||||
%pythoncode %{
|
%pythoncode %{
|
||||||
mypath = os.path.dirname("/a/b/c/d.txt")
|
mypath = os.path.dirname("/a/b/c/d.txt")
|
||||||
funcpath = None
|
funcpath = None
|
||||||
staticfuncpath = None
|
staticfuncpath = None
|
||||||
def grabpath():
|
def grabpath():
|
||||||
return funcpath
|
return funcpath
|
||||||
def grabstaticpath():
|
def grabstaticpath():
|
||||||
return staticfuncpath
|
return staticfuncpath
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%pythonappend Test::func %{
|
%pythonappend Test::func %{
|
||||||
funcpath = os.path.dirname(funcpath)
|
funcpath = os.path.dirname(funcpath)
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%pythonprepend Test::func %{
|
%pythonprepend Test::func %{
|
||||||
global funcpath
|
global funcpath
|
||||||
funcpath = mypath
|
funcpath = mypath
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%pythonappend Test::static_func %{
|
%pythonappend Test::static_func %{
|
||||||
|
|
@ -29,9 +29,9 @@ pass
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%pythonprepend Test::static_func {
|
%pythonprepend Test::static_func {
|
||||||
global staticfuncpath
|
global staticfuncpath
|
||||||
staticfuncpath = mypath
|
staticfuncpath = mypath
|
||||||
pass
|
pass
|
||||||
}
|
}
|
||||||
|
|
||||||
%pythonbegin %{
|
%pythonbegin %{
|
||||||
|
|
|
||||||
|
|
@ -789,7 +789,7 @@ AC_SUBST(PY3INCLUDE)
|
||||||
AC_SUBST(PY3LIB)
|
AC_SUBST(PY3LIB)
|
||||||
AC_SUBST(PY3LINK)
|
AC_SUBST(PY3LINK)
|
||||||
AC_SUBST(PYTHON3DYNAMICLINKING)
|
AC_SUBST(PYTHON3DYNAMICLINKING)
|
||||||
|
AC_CHECK_PROGS(PEP8, pep8)
|
||||||
|
|
||||||
#----------------------------------------------------------------
|
#----------------------------------------------------------------
|
||||||
# Look for Perl5
|
# Look for Perl5
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue