Complete switch from pep8 to pycodestyle for Python testing
This commit is contained in:
parent
0b0aed6842
commit
aff36823df
4 changed files with 17 additions and 13 deletions
|
|
@ -7,6 +7,10 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
|
||||||
Version 4.0.0 (in progress)
|
Version 4.0.0 (in progress)
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
|
2017-12-30: wsfulton
|
||||||
|
[Python] Replace pep8 with pycodestyle for checking the Python code style when
|
||||||
|
running Python tests.
|
||||||
|
|
||||||
2017-12-13: wsfulton
|
2017-12-13: wsfulton
|
||||||
[Perl] add missing support for directorfree typemaps.
|
[Perl] add missing support for directorfree typemaps.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -334,8 +334,8 @@ else
|
||||||
SWIGOPTPY3 = -py3
|
SWIGOPTPY3 = -py3
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PEP8 = @PEP8@
|
PYCODESTYLE = @PYCODESTYLE@
|
||||||
PEP8_FLAGS = --ignore=E402,E501,E30,W291,W391
|
PYCODESTYLE_FLAGS = --ignore=E402,E501,E30,W291,W391
|
||||||
|
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
# Build a C dynamically loadable module
|
# Build a C dynamically loadable module
|
||||||
|
|
@ -389,8 +389,8 @@ endif
|
||||||
PY2TO3 = @PY2TO3@ `@PY2TO3@ -l | grep -v -E "Available|import$$" | awk '{print "-f "$$0}'`
|
PY2TO3 = @PY2TO3@ `@PY2TO3@ -l | grep -v -E "Available|import$$" | awk '{print "-f "$$0}'`
|
||||||
|
|
||||||
python_run: $(PYSCRIPT)
|
python_run: $(PYSCRIPT)
|
||||||
ifneq (,$(PEP8))
|
ifneq (,$(PYCODESTYLE))
|
||||||
$(COMPILETOOL) $(PEP8) $(PEP8_FLAGS) $(PYSCRIPT)
|
$(COMPILETOOL) $(PYCODESTYLE) $(PYCODESTYLE_FLAGS) $(PYSCRIPT)
|
||||||
endif
|
endif
|
||||||
env PYTHONPATH=$$PWD $(RUNTOOL) $(PYTHON) $(PYSCRIPT) $(RUNPIPE)
|
env PYTHONPATH=$$PWD $(RUNTOOL) $(PYTHON) $(PYSCRIPT) $(RUNPIPE)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ endif
|
||||||
|
|
||||||
LANGUAGE = python
|
LANGUAGE = python
|
||||||
PYTHON = $(PYBIN)
|
PYTHON = $(PYBIN)
|
||||||
PEP8 = @PEP8@
|
PYCODESTYLE = @PYCODESTYLE@
|
||||||
PEP8_FLAGS = --ignore=E30,E402,E501,E731,W291,W391
|
PYCODESTYLE_FLAGS = --ignore=E30,E402,E501,E731,W291,W391
|
||||||
|
|
||||||
#*_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
|
||||||
|
|
@ -141,12 +141,12 @@ py_runme = $(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)
|
||||||
py2_runme = $(SCRIPTPREFIX)$*$(PY2SCRIPTSUFFIX)
|
py2_runme = $(SCRIPTPREFIX)$*$(PY2SCRIPTSUFFIX)
|
||||||
py3_runme = $(SCRIPTPREFIX)$*$(PY3SCRIPTSUFFIX)
|
py3_runme = $(SCRIPTPREFIX)$*$(PY3SCRIPTSUFFIX)
|
||||||
|
|
||||||
ifneq (,$(PEP8))
|
ifneq (,$(PYCODESTYLE))
|
||||||
check_pep8 = $(COMPILETOOL) $(PEP8) $(PEP8_FLAGS) $(SCRIPTPREFIX)$*.py
|
check_pep8 = $(COMPILETOOL) $(PYCODESTYLE) $(PYCODESTYLE_FLAGS) $(SCRIPTPREFIX)$*.py
|
||||||
|
|
||||||
check_pep8_multi_cpp = \
|
check_pep8_multi_cpp = \
|
||||||
for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \
|
for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \
|
||||||
$(COMPILETOOL) $(PEP8) $(PEP8_FLAGS) $$f.py; \
|
$(COMPILETOOL) $(PYCODESTYLE) $(PYCODESTYLE_FLAGS) $$f.py; \
|
||||||
done
|
done
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -895,11 +895,11 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -n "$PYINCLUDE" || test -n "$PY3INCLUDE" ; then
|
if test -n "$PYINCLUDE" || test -n "$PY3INCLUDE" ; then
|
||||||
AC_CHECK_PROGS(PEP8, pycodestyle)
|
AC_CHECK_PROGS(PYCODESTYLE, pycodestyle)
|
||||||
if test -n "$PEP8"; then
|
if test -n "$PYCODESTYLE"; then
|
||||||
AC_MSG_CHECKING(pycodestyle version)
|
AC_MSG_CHECKING(pycodestyle version)
|
||||||
pep8_version=`$PEP8 --version 2>/dev/null`
|
pycodestyle_version=`$PYCODESTYLE --version 2>/dev/null`
|
||||||
AC_MSG_RESULT($pep8_version)
|
AC_MSG_RESULT($pycodestyle_version)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue