From 9c87c39e65547004031284080749bc66dab1a8f9 Mon Sep 17 00:00:00 2001 From: Petr Spacek Date: Thu, 8 Dec 2016 11:26:18 +0100 Subject: [PATCH] Build: always use Pylint from Python version used for rest of the build configure option --with/without-pylint was replaced by --enable/disable-pylint. Pylint is always called as $(PYTHON) -m python. If you need to override Pylint version, use command "make pylint PYTHON=xxx". https://fedorahosted.org/freeipa/ticket/157 Reviewed-By: Martin Basti Reviewed-By: Christian Heimes --- Makefile.am | 2 +- configure.ac | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Makefile.am b/Makefile.am index a7c74b06a..73bd37899 100644 --- a/Makefile.am +++ b/Makefile.am @@ -164,7 +164,7 @@ pylint: $(top_builddir)/ipapython/version.py ipasetup.py -name '*.py' -print -o \ -type f -exec grep -qsm1 '^#!.*\bpython' '{}' \; -print`; \ echo "Pylint is running, please wait ..."; \ - PYTHONPATH=$(top_srcdir) $(PYLINT) \ + PYTHONPATH=$(top_srcdir) $(PYTHON) -m pylint \ --rcfile=$(top_srcdir)/pylintrc $${FILES} .PHONY: jslint jslint-ui jslint-ui-test jslint-html \ diff --git a/configure.ac b/configure.ac index c02a672f7..cf4392bfe 100644 --- a/configure.ac +++ b/configure.ac @@ -435,16 +435,19 @@ AC_ARG_ENABLE([i18ntests], AC_SUBST([i18ntests]) AM_CONDITIONAL([WITH_POLINT], [test "x${enable_i18ntests}" == "xyes"]) -AC_ARG_WITH([pylint], - AS_HELP_STRING([--with-pylint=path], - [path to Pylint]), -dnl --without-pylint will set PYLINT=no - [PYLINT=$with_pylint], - [AC_PATH_PROG([PYLINT], [pylint])] +AC_ARG_ENABLE([pylint], + AS_HELP_STRING([--disable-pylint], + [skip Pylint in make lint target]), + [PYLINT=no], + [PYLINT=yes + AC_MSG_CHECKING([for Pylint]) + $PYTHON -m pylint --version > /dev/null + if test "$?" != "0"; then + AC_MSG_ERROR([cannot find pylint for $PYTHON]) + fi + AC_MSG_RESULT([yes]) + ] ) -if test "x${PYLINT}" == "x"; then - AC_MSG_ERROR([cannot find Pylint]) -fi AC_SUBST([PYLINT]) AM_CONDITIONAL([WITH_PYLINT], [test "x${PYLINT}" != "xno"])