Skip to content

Commit

Permalink
Enable pep8 check
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Jun 7, 2014
1 parent 6fe71da commit 7a4cef9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions Examples/test-suite/python/Makefile.in
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -126,13 +129,19 @@ 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.


py_runme = $(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) 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 = \
Expand Down
22 changes: 11 additions & 11 deletions Examples/test-suite/python_append.i
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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 %{
Expand All @@ -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 %{
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7a4cef9

Please sign in to comment.