Changeset: afa19ab742dd for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=afa19ab742dd
Modified Files:
        NT/rules.msc
        configure.ag
        testing/Mtest.py.in
Branch: default
Log Message:

Move test for Python modules pandas and scipy into Mtest.py.
That's the only place this knowledge is actually needed.


diffs (95 lines):

diff --git a/NT/rules.msc b/NT/rules.msc
--- a/NT/rules.msc
+++ b/NT/rules.msc
@@ -351,14 +351,8 @@ create_winconfig_conds_new_py:
        $(ECHO) HAVE_LIBBZ2_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py"
 !ENDIF
 !IFDEF HAVE_LIBPY
-!IFDEF HAVE_LIBPANDAS
-       $(ECHO) HAVE_LIBPANDAS_FALSE='#' >> "$(TOPDIR)\winconfig_conds_new.py"
-!ELSE
-       $(ECHO) HAVE_LIBPANDAS_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py"
-!ENDIF
        $(ECHO) HAVE_LIBPY_FALSE='#' >> "$(TOPDIR)\winconfig_conds_new.py"
 !ELSE
-       $(ECHO) HAVE_LIBPANDAS_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py"
        $(ECHO) HAVE_LIBPY_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py"
 !ENDIF
 !IFDEF HAVE_LIBR
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2327,8 +2327,6 @@ AM_CONDITIONAL(HAVE_LIBR, test x"$have_l
 
 # Python API (Python UDFs)
 have_libpy=no
-have_libpandas=no
-have_libscipy=no
 if test "x$enable_pyintegration" != xno; then
        case "$enable_pyintegration" in
        yes|auto)
@@ -2397,14 +2395,6 @@ if test "x$enable_pyintegration" != xno;
                        AC_DEFINE(HAVE_LIBPY, 1, [Define if we can link to 
python])
                        AC_SUBST(libpy_CFLAGS, $libpy_CFLAGS)
                        AC_SUBST(libpy_LIBS, $libpy_LIBS)
-                       PANDAS=`$PYTHON_CMD -c "import pandas; print(True)"`
-                       if [test "x$PANDAS" = xTrue]; then
-                               have_libpandas=yes
-                       fi
-                       SCIPY=`$PYTHON_CMD -c "import scipy; print(True)"`
-                       if [test "x$SCIPY" = xTrue]; then
-                               have_libscipy=yes
-                       fi
                else
                        if test "x$enable_pyintegration" = xyes; then
                                AC_MSG_ERROR([Python.h not found])
@@ -2418,8 +2408,6 @@ if test "x$enable_pyintegration" != xno;
        fi
 fi
 AM_CONDITIONAL(HAVE_LIBPY, test x"$have_libpy" != xno)
-AM_CONDITIONAL(HAVE_LIBPANDAS, test x"$have_libpandas" != xno)
-AM_CONDITIONAL(HAVE_LIBSCIPY, test x"$have_libscipy" != xno)
 
 AC_CHECK_HEADER([sys/sem.h], [SEMOP=True], [SEMOP=False])
 if [test "x$SEMOP" = "xTrue"]; then
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -312,9 +312,7 @@ CONDITIONALS = {
     'HAVE_JAVAMEROCONTROL' : "@HAVE_JAVAMEROCONTROL_FALSE@",
     'HAVE_LIBBZ2'          : "@HAVE_LIBBZ2_FALSE@",
     'HAVE_LIBR'            : "@HAVE_LIBR_FALSE@",
-    'HAVE_LIBPANDAS'       : "@HAVE_LIBPANDAS_FALSE@",
     'HAVE_LIBPY'           : "@HAVE_LIBPY_FALSE@",
-    'HAVE_LIBSCIPY'        : "@HAVE_LIBSCIPY_FALSE@",
     'HAVE_LIBXML'          : "@HAVE_LIBXML_FALSE@",
     'HAVE_LIBZ'            : "@HAVE_LIBZ_FALSE@",
     'HAVE_LIDAR'           : "@HAVE_LIDAR_FALSE@",
@@ -342,6 +340,8 @@ CONDITIONALS = {
     'HAVE_JDBCTESTS_JAR'   : "",
     'HAVE_JDBCTESTS_DIR'   : "",
     'HAVE_JDBCTESTS'       : "",
+    'HAVE_LIBPANDAS'       : "",
+    'HAVE_LIBSCIPY'        : "",
     'HAVE_PHP'             : "",
     'HAVE_PYMONETDB'       : "",
     'HAVE_RUBY'            : "",
@@ -3675,6 +3675,18 @@ def main(argv) :
         print('Python available, but pymonetdb package not available')
     else:
         CONDITIONALS['HAVE_PYMONETDB'] = '#'
+    try:
+        import scipy
+    except ImportError:
+        pass
+    else:
+        CONDITIONALS['HAVE_LIBSCIPY'] = '#'
+    try:
+        import pandas
+    except ImportError:
+        pass
+    else:
+        CONDITIONALS['HAVE_LIBPANDAS'] = '#'
     if CheckExec('php'):
         CONDITIONALS['HAVE_PHP'] = '#'
 #     else:
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to