Whamcloud - gitweb
EX-6279 lipe: need python and pylint for all builds
authorLei Feng <flei@whamcloud.com>
Tue, 1 Nov 2022 23:12:53 +0000 (07:12 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 11 Nov 2022 09:41:15 +0000 (09:41 +0000)
Check python and pylint ready for all builds.

Signed-off-by: Lei Feng <flei@whamcloud.com>
Change-Id: I7e93ec3cdd51d96ed938f6fa85953b9e3f250877
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/49012
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lipe/configure.ac

index 1ef9b9d..c90947f 100644 (file)
@@ -194,19 +194,23 @@ AC_ARG_ENABLE([server],
 AC_MSG_RESULT([$enable_server])
 AM_CONDITIONAL([BUILD_SERVER], [test x$enable_server = xyes])
 
-# ------- check for python --------
-AM_COND_IF([BUILD_SERVER],
-       [AC_CHECK_PROGS([PYTHON], [python3.6], [])
-       if test "x$PYTHON" = "x"; then
-               AC_MSG_ERROR([Python is needed for tests. Install python please.])
-       fi])
+# ------- check for python >= 3.6  --------
+AC_CHECK_PROGS([PYTHON], [python3], [])
+if test "x$PYTHON" = "x"; then
+       AC_MSG_ERROR([Python >= 3.6 is needed for lipe. Install python please.])
+fi
+
+ac_supports_python_ver=`$PYTHON -c "import sys; \
+       print (sys.hexversion >= 0x3060000)"`
+if test "$ac_supports_python_ver" != "True"; then
+       AC_MSG_ERROR([Python >= 3.6 is needed for lipe. Upgrade python please.])
+fi
 
 # ------- check for pylint --------
-AM_COND_IF([BUILD_SERVER],
-       [AC_CHECK_PROGS([PYLINT], [pylint-3.6], [])
-       if test "x$PYLINT" = "x"; then
-               AC_MSG_ERROR([pylint-3.6 is needed to check python coding style. Install pylint please.])
-       fi])
+AC_CHECK_PROGS([PYLINT], [pylint-3], [])
+if test "x$PYLINT" = "x"; then
+       AC_MSG_ERROR([pylint-3 is needed to check python coding style. Install pylint please.])
+fi
 
 # ------- check for libssh --------
 AC_CHECK_LIB([ssh], [ssh_new], [