Complete switch from pep8 to pycodestyle for Python testing

This commit is contained in:
William S Fulton 2017-12-30 21:37:05 +00:00
commit aff36823df
4 changed files with 17 additions and 13 deletions

View file

@ -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)
===========================
2017-12-30: wsfulton
[Python] Replace pep8 with pycodestyle for checking the Python code style when
running Python tests.
2017-12-13: wsfulton
[Perl] add missing support for directorfree typemaps.

View file

@ -334,8 +334,8 @@ else
SWIGOPTPY3 = -py3
endif
PEP8 = @PEP8@
PEP8_FLAGS = --ignore=E402,E501,E30,W291,W391
PYCODESTYLE = @PYCODESTYLE@
PYCODESTYLE_FLAGS = --ignore=E402,E501,E30,W291,W391
# ----------------------------------------------------------------
# Build a C dynamically loadable module
@ -389,8 +389,8 @@ endif
PY2TO3 = @PY2TO3@ `@PY2TO3@ -l | grep -v -E "Available|import$$" | awk '{print "-f "$$0}'`
python_run: $(PYSCRIPT)
ifneq (,$(PEP8))
$(COMPILETOOL) $(PEP8) $(PEP8_FLAGS) $(PYSCRIPT)
ifneq (,$(PYCODESTYLE))
$(COMPILETOOL) $(PYCODESTYLE) $(PYCODESTYLE_FLAGS) $(PYSCRIPT)
endif
env PYTHONPATH=$$PWD $(RUNTOOL) $(PYTHON) $(PYSCRIPT) $(RUNPIPE)

View file

@ -10,8 +10,8 @@ endif
LANGUAGE = python
PYTHON = $(PYBIN)
PEP8 = @PEP8@
PEP8_FLAGS = --ignore=E30,E402,E501,E731,W291,W391
PYCODESTYLE = @PYCODESTYLE@
PYCODESTYLE_FLAGS = --ignore=E30,E402,E501,E731,W291,W391
#*_runme.py for Python 2.x, *_runme3.py for Python 3.x
PY2SCRIPTSUFFIX = _runme.py
@ -141,12 +141,12 @@ py_runme = $(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)
py2_runme = $(SCRIPTPREFIX)$*$(PY2SCRIPTSUFFIX)
py3_runme = $(SCRIPTPREFIX)$*$(PY3SCRIPTSUFFIX)
ifneq (,$(PEP8))
check_pep8 = $(COMPILETOOL) $(PEP8) $(PEP8_FLAGS) $(SCRIPTPREFIX)$*.py
ifneq (,$(PYCODESTYLE))
check_pep8 = $(COMPILETOOL) $(PYCODESTYLE) $(PYCODESTYLE_FLAGS) $(SCRIPTPREFIX)$*.py
check_pep8_multi_cpp = \
for f in `cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list` ; do \
$(COMPILETOOL) $(PEP8) $(PEP8_FLAGS) $$f.py; \
$(COMPILETOOL) $(PYCODESTYLE) $(PYCODESTYLE_FLAGS) $$f.py; \
done
endif

View file

@ -895,11 +895,11 @@ else
fi
if test -n "$PYINCLUDE" || test -n "$PY3INCLUDE" ; then
AC_CHECK_PROGS(PEP8, pycodestyle)
if test -n "$PEP8"; then
AC_CHECK_PROGS(PYCODESTYLE, pycodestyle)
if test -n "$PYCODESTYLE"; then
AC_MSG_CHECKING(pycodestyle version)
pep8_version=`$PEP8 --version 2>/dev/null`
AC_MSG_RESULT($pep8_version)
pycodestyle_version=`$PYCODESTYLE --version 2>/dev/null`
AC_MSG_RESULT($pycodestyle_version)
fi
fi