Skip to content

Commit

Permalink
configure.ac: fall back to pylint if pylint3 not found
Browse files Browse the repository at this point in the history
Pylint has dropped Py2 support upstream[1], so Pylint versions after 2.0
effectively only support Python 3. Debian shipped with dual pylint
versions in Buster: 1.9 as plain `pylint' for checking Python 2 code,
and 2.2.2 as `pylint3' for checking Python 3 code. On Debian Sid
however, as of today, there is only one `pylint' package, offering
`/usr/bin/pylint' which is Python-3-only, so our current strategy of
looking for pylint3 won't work. I expect most distributions will end
up calling pylint simply `pylint' (as Debian Bullseye does) and only
support Python 3.

Fix this by checking for `pylint3', and then for `pylint' if the former
was not found. In case we end up with `pylint', we also need to check
that this is not some ancient 1.x version possibly running on/supporting
only Python 2.

[1] pylint-dev/pylint#1763

Signed-off-by: Apollon Oikonomopoulos <apoikos@dmesg.gr>
  • Loading branch information
apoikos committed Dec 16, 2019
1 parent 296f1dc commit a823169
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -571,12 +571,24 @@ then
documentation rebuild not possible]))
fi

# Check for pylint3
AC_ARG_VAR(PYLINT, [pylint3 path])
# Check for pylint
AC_ARG_VAR(PYLINT, [pylint path])
AC_PATH_PROG(PYLINT, [pylint3], [])
if test -z "$PYLINT"
then
AC_MSG_WARN([pylint not found, checking code will not be possible])
AC_PATH_PROG(PYLINT, [pylint], [])
if test -z "$PYLINT"
then
AC_MSG_WARN([pylint not found, checking code will not be possible])
else
if $PYLINT --version 2>/dev/null | grep -q '^pylint 1\.'
then
# Make sure this is not pylint 1
AC_MSG_WARN([pylint 1.x found, checking code will not be possible.
Please upgrade pylint to at least 2.0.])
PYLINT=
fi
fi
fi

# Check for pep8
Expand Down

0 comments on commit a823169

Please sign in to comment.