Changeset: 4d694615ef7a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4d694615ef7a
Added Files:
        clients/python2/MANIFEST.in
        clients/python2/Makefile.ag
        clients/python2/README.rst
        clients/python2/examples/basics.py
        clients/python2/examples/mclient.py
        clients/python2/examples/perf.py
        clients/python2/monetdb/__init__.py
        clients/python2/monetdb/control.py
        clients/python2/monetdb/exceptions.py
        clients/python2/monetdb/mapi.py
        clients/python2/monetdb/sql/__init__.py
        clients/python2/monetdb/sql/connections.py
        clients/python2/monetdb/sql/converters.py
        clients/python2/monetdb/sql/cursors.py
        clients/python2/monetdb/sql/monetize.py
        clients/python2/monetdb/sql/pythonize.py
        clients/python2/monetdb/sql/types.py
        clients/python2/setup.py
        clients/python2/test/capabilities.py
        clients/python2/test/control.py
        clients/python2/test/dbapi20.py
        clients/python2/test/run.sh
        clients/python2/test/runtests.py
        clients/python2/test/test_control.py
        sql/test/BugTracker-2012/Tests/inet-casts.Bug-3205.sql
        sql/test/BugTracker-2012/Tests/inet-casts.Bug-3205.stable.err
        sql/test/BugTracker-2012/Tests/inet-casts.Bug-3205.stable.out
Removed Files:
        clients/python/MANIFEST.in
        clients/python/Makefile.ag
        clients/python/README.rst
        clients/python/examples/basics.py
        clients/python/examples/mclient.py
        clients/python/examples/perf.py
        clients/python/monetdb/__init__.py
        clients/python/monetdb/control.py
        clients/python/monetdb/exceptions.py
        clients/python/monetdb/mapi.py
        clients/python/monetdb/sql/__init__.py
        clients/python/monetdb/sql/connections.py
        clients/python/monetdb/sql/converters.py
        clients/python/monetdb/sql/cursors.py
        clients/python/monetdb/sql/monetize.py
        clients/python/monetdb/sql/pythonize.py
        clients/python/monetdb/sql/types.py
        clients/python/setup.py
        clients/python/test/capabilities.py
        clients/python/test/control.py
        clients/python/test/dbapi20.py
        clients/python/test/run.sh
        clients/python/test/runtests.py
        clients/python/test/test_control.py
Modified Files:
        MonetDB.spec
        buildtools/autogen/autogen/am.py
        clients/Makefile.ag
        configure.ag
        debian/rules
        monetdb5/modules/atoms/inet.c
        sql/test/BugTracker-2012/Tests/All
        testing/Mfilter.py.in
        testing/Mtest.py.in
Branch: default
Log Message:

Merged from Feb2013


diffs (truncated from 568 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -650,7 +650,7 @@ developer, but if you do want to test, t
        --with-mseed=no \
        --with-perl=yes \
        --with-pthread=yes \
-       --with-python=yes \
+       --with-python2=yes \
        --with-python3=yes \
        --with-readline=yes \
        --with-rubygem=yes \
diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py
--- a/buildtools/autogen/autogen/am.py
+++ b/buildtools/autogen/autogen/am.py
@@ -1022,8 +1022,8 @@ def am_python_generic(fd, var, python, a
     for pkgdir in sorted(pkgdirs, reverse = True):
         fd.write("\t[ '$(srcdir)' -ef . ] || rm -r '%s'\n" % pkgdir)
 
-def am_python(fd, var, python, am):
-    am_python_generic(fd, var, python, am, 'PYTHON')
+def am_python2(fd, var, python, am):
+    am_python_generic(fd, var, python, am, 'PYTHON2')
 
 def am_python3(fd, var, python3, am):
     am_python_generic(fd, var, python3, am, 'PYTHON3')
@@ -1156,7 +1156,7 @@ output_funcs = {'SUBDIRS': am_subdirs,
                 'HEADERS': am_headers,
                 'ANT': am_ant,
                 'GEM': am_gem,
-                'PYTHON': am_python,
+                'PYTHON2': am_python2,
                 'PYTHON3': am_python3,
                 }
 
diff --git a/clients/Makefile.ag b/clients/Makefile.ag
--- a/clients/Makefile.ag
+++ b/clients/Makefile.ag
@@ -15,6 +15,6 @@
 # Copyright August 2008-2012 MonetDB B.V.
 # All Rights Reserved.
 
-SUBDIRS = mapilib mapiclient HAVE_ODBC?odbc HAVE_PERL?perl php 
HAVE_RUBYGEM?ruby examples HAVE_PYTHON?python HAVE_PYTHON3?python3 
NATIVE_WIN32?NT
+SUBDIRS = mapilib mapiclient HAVE_ODBC?odbc HAVE_PERL?perl php 
HAVE_RUBYGEM?ruby examples HAVE_PYTHON2?python2 HAVE_PYTHON3?python3 
NATIVE_WIN32?NT
 
 EXTRA_DIST_DIR = Tests
diff --git a/clients/python/MANIFEST.in b/clients/python2/MANIFEST.in
rename from clients/python/MANIFEST.in
rename to clients/python2/MANIFEST.in
diff --git a/clients/python/Makefile.ag b/clients/python2/Makefile.ag
rename from clients/python/Makefile.ag
rename to clients/python2/Makefile.ag
--- a/clients/python/Makefile.ag
+++ b/clients/python2/Makefile.ag
@@ -15,7 +15,7 @@
 # Copyright August 2008-2012 MonetDB B.V.
 # All Rights Reserved.
 
-python_setup = {
+python2_setup = {
        FILES = setup.py
 }
 
diff --git a/clients/python/README.rst b/clients/python2/README.rst
rename from clients/python/README.rst
rename to clients/python2/README.rst
diff --git a/clients/python/examples/basics.py 
b/clients/python2/examples/basics.py
rename from clients/python/examples/basics.py
rename to clients/python2/examples/basics.py
diff --git a/clients/python/examples/mclient.py 
b/clients/python2/examples/mclient.py
rename from clients/python/examples/mclient.py
rename to clients/python2/examples/mclient.py
diff --git a/clients/python/examples/perf.py b/clients/python2/examples/perf.py
rename from clients/python/examples/perf.py
rename to clients/python2/examples/perf.py
diff --git a/clients/python/monetdb/__init__.py 
b/clients/python2/monetdb/__init__.py
rename from clients/python/monetdb/__init__.py
rename to clients/python2/monetdb/__init__.py
diff --git a/clients/python/monetdb/control.py 
b/clients/python2/monetdb/control.py
rename from clients/python/monetdb/control.py
rename to clients/python2/monetdb/control.py
diff --git a/clients/python/monetdb/exceptions.py 
b/clients/python2/monetdb/exceptions.py
rename from clients/python/monetdb/exceptions.py
rename to clients/python2/monetdb/exceptions.py
diff --git a/clients/python/monetdb/mapi.py b/clients/python2/monetdb/mapi.py
rename from clients/python/monetdb/mapi.py
rename to clients/python2/monetdb/mapi.py
diff --git a/clients/python/monetdb/sql/__init__.py 
b/clients/python2/monetdb/sql/__init__.py
rename from clients/python/monetdb/sql/__init__.py
rename to clients/python2/monetdb/sql/__init__.py
diff --git a/clients/python/monetdb/sql/connections.py 
b/clients/python2/monetdb/sql/connections.py
rename from clients/python/monetdb/sql/connections.py
rename to clients/python2/monetdb/sql/connections.py
diff --git a/clients/python/monetdb/sql/converters.py 
b/clients/python2/monetdb/sql/converters.py
rename from clients/python/monetdb/sql/converters.py
rename to clients/python2/monetdb/sql/converters.py
diff --git a/clients/python/monetdb/sql/cursors.py 
b/clients/python2/monetdb/sql/cursors.py
rename from clients/python/monetdb/sql/cursors.py
rename to clients/python2/monetdb/sql/cursors.py
diff --git a/clients/python/monetdb/sql/monetize.py 
b/clients/python2/monetdb/sql/monetize.py
rename from clients/python/monetdb/sql/monetize.py
rename to clients/python2/monetdb/sql/monetize.py
diff --git a/clients/python/monetdb/sql/pythonize.py 
b/clients/python2/monetdb/sql/pythonize.py
rename from clients/python/monetdb/sql/pythonize.py
rename to clients/python2/monetdb/sql/pythonize.py
diff --git a/clients/python/monetdb/sql/types.py 
b/clients/python2/monetdb/sql/types.py
rename from clients/python/monetdb/sql/types.py
rename to clients/python2/monetdb/sql/types.py
diff --git a/clients/python/setup.py b/clients/python2/setup.py
rename from clients/python/setup.py
rename to clients/python2/setup.py
diff --git a/clients/python/test/capabilities.py 
b/clients/python2/test/capabilities.py
rename from clients/python/test/capabilities.py
rename to clients/python2/test/capabilities.py
diff --git a/clients/python/test/control.py b/clients/python2/test/control.py
rename from clients/python/test/control.py
rename to clients/python2/test/control.py
diff --git a/clients/python/test/dbapi20.py b/clients/python2/test/dbapi20.py
rename from clients/python/test/dbapi20.py
rename to clients/python2/test/dbapi20.py
diff --git a/clients/python/test/run.sh b/clients/python2/test/run.sh
rename from clients/python/test/run.sh
rename to clients/python2/test/run.sh
diff --git a/clients/python/test/runtests.py b/clients/python2/test/runtests.py
rename from clients/python/test/runtests.py
rename to clients/python2/test/runtests.py
diff --git a/clients/python/test/test_control.py 
b/clients/python2/test/test_control.py
rename from clients/python/test/test_control.py
rename to clients/python2/test/test_control.py
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1099,73 +1099,99 @@ AC_SUBST(PERL)
 AM_CONDITIONAL(HAVE_PERL, test x"$have_perl" != xno)
 AC_SUBST(PERL_LIBDIR)
 
-have_python=auto
-PYTHON=python
+# check major version of python
+# check if python2 and python3 exist
+# if python2 or python3 doesn't exist, use python if major matches
 
-AC_ARG_WITH(python,
-       AS_HELP_STRING([--with-python=FILE], [python is installed as FILE]),
-       have_python="$withval")
+AC_PATH_PROG(PYTHON,python,no,$PATH)
+PYTHON_MAJ=
+if test "x$PYTHON" != xno; then
+       AC_MSG_CHECKING([major version of $PYTHON])
+       case "`"$PYTHON" -V 2>&1`" in
+               "Python 2."[[67]]*)  # older Pythons don't get Python3 syntax
+                       PYTHON_MAJ=2
+                       AC_MSG_RESULT([2])
+                       ;;
+               "Python 3."*)
+                       PYTHON_MAJ=3
+                       AC_MSG_RESULT([3])
+                       ;;
+               *)
+                       AC_MSG_ERROR([unknown Python version])
+                       ;;
+       esac
+fi
 
-case "$have_python" in
+
+have_python2=auto
+PYTHON2=python2
+
+AC_ARG_WITH(python2,
+       AS_HELP_STRING([--with-python2=FILE], [python2 is installed as FILE]),
+       have_python2="$withval")
+
+case "$have_python2" in
        yes|no|auto) ;;
        *)
-               PYTHON="$have_python"
-               have_python=yes
+               PYTHON2="$have_python"
                ;;
 esac
 
-if test "x$have_python" != xno; then
+if test "x$have_python2" != xno; then
        if test x$cross_compiling != xyes; then
-               AC_PATH_PROG(PYTHON,$PYTHON,no,$PATH)
-               if test "x$PYTHON" = xno; then
-                       if test "x$have_python" != xauto; then
-                               AC_MSG_ERROR([No Python executable found])
+               AC_PATH_PROG(PYTHON2,$PYTHON2,no,$PATH)
+               if test "x$PYTHON2" = xno; then
+                       if ( test "x$have_python2" = xyes || test 
"x$have_python2" = xauto ) && test "x$PYTHON_MAJ" = 2; then
+                               PYTHON2="$PYTHON"
+                               have_python2=yes
+                       elif test "x$have_python2" != xauto; then
+                               AC_MSG_ERROR([Python 2 executable not found])
                        fi
-                       have_python=no
+                       have_python2=no
                fi
        fi
 fi
 
-if test "x$have_python" != xno; then
-       have_python_libdir=auto
+if test "x$have_python2" != xno; then
+       have_python2_libdir=auto
 
-       AC_ARG_WITH(python-libdir,
-               AS_HELP_STRING([--with-python-libdir=DIR],
-                       [relative path for Python library directory (where 
Python modules should be installed)]),
-               have_python_libdir="$withval")
+       AC_ARG_WITH(python2-libdir,
+               AS_HELP_STRING([--with-python2-libdir=DIR],
+                       [relative path for Python 2 library directory (where 
Python 2 modules should be installed)]),
+               have_python2_libdir="$withval")
 
-       case "$have_python_libdir" in
+       case "$have_python2_libdir" in
                yes|auto)
                        if test x$cross_compiling = xyes; then
-                               AC_MSG_ERROR([Must specify --with-python-libdir 
when cross compiling])
+                               AC_MSG_ERROR([Must specify 
--with-python2-libdir when cross compiling])
                        fi
-                       case "$host_os-`"$PYTHON" -V 2>&1`" in
+                       case "$host_os-`"$PYTHON2" -V 2>&1`" in
                                darwin9*-*2.5.1)
-                                       PYTHON_LIBDIR="`"$PYTHON" -c 'import 
distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,1,"")' 
2>/dev/null`/site-packages";;
+                                       PYTHON2_LIBDIR="`"$PYTHON2" -c 'import 
distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,1,"")' 
2>/dev/null`/site-packages";;
                                *)
-                                       PYTHON_LIBDIR="`"$PYTHON" -c 'import 
distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,0,"")' 
2>/dev/null`";;
+                                       PYTHON2_LIBDIR="`"$PYTHON2" -c 'import 
distutils.sysconfig; print distutils.sysconfig.get_python_lib(0,0,"")' 
2>/dev/null`";;
                        esac
                        ;;
                no)     ;;
                $Qprefix/*) dnl dubious
-                       PYTHON_LIBDIR=`echo "$have_python_libdir" | sed 
"s|^$Qprefix/||"`
-                       have_python_libdir=yes
+                       PYTHON2_LIBDIR=`echo "$have_python2_libdir" | sed 
"s|^$Qprefix/||"`
+                       have_python2_libdir=yes
                        ;;
-               *)      PYTHON_LIBDIR="$have_python_libdir"
-                       have_python_libdir=yes
+               *)      PYTHON2_LIBDIR="$have_python2_libdir"
+                       have_python2_libdir=yes
                        ;;
        esac
 else
-       # no Python implies no Python libraries
-       have_python_libdir=no
-       PYTHON_LIBDIR=""
+       # no Python 2 implies no Python 2 libraries
+       have_python2_libdir=no
+       PYTHON2_LIBDIR=""
        # and no interpreter
-       PYTHON=false
+       PYTHON2=false
 fi
 
-AC_SUBST(PYTHON)
-AM_CONDITIONAL(HAVE_PYTHON, test x"$have_python" != xno)
-AC_SUBST(PYTHON_LIBDIR)
+AC_SUBST(PYTHON2)
+AM_CONDITIONAL(HAVE_PYTHON2, test x"$have_python2" != xno)
+AC_SUBST(PYTHON2_LIBDIR)
 
 have_python3=auto
 PYTHON3=python3
@@ -1178,7 +1204,6 @@ case "$have_python3" in
        yes|no|auto) ;;
        *)
                PYTHON3="$have_python3"
-               have_python3=yes
                ;;
 esac
 
@@ -1186,8 +1211,11 @@ if test "x$have_python3" != xno; then
        if test x$cross_compiling != xyes; then
                AC_PATH_PROG(PYTHON3,$PYTHON3,no,$PATH)
                if test "x$PYTHON3" = xno; then
-                       if test "x$have_python3" != xauto; then
-                               AC_MSG_ERROR([No Python3 executable found])
+                       if ( test "x$have_python3" = xyes || test 
"x$have_python3" = xauto ) && test "x$PYTHON_MAJ" = 3; then
+                               PYTHON3="$PYTHON"
+                               have_python3=yes
+                       elif test "x$have_python3" != xauto; then
+                               AC_MSG_ERROR([Python3 executable not found])
                        fi
                        have_python3=no
                fi
@@ -1199,7 +1227,7 @@ if test "x$have_python3" != xno; then
 
        AC_ARG_WITH(python3-libdir,
                AS_HELP_STRING([--with-python3-libdir=DIR],
-                       [relative path for Python3 library directory (where 
Python3 modules should be installed)]),
+                       [relative path for Python 3 library directory (where 
Python 3 modules should be installed)]),
                have_python3_libdir="$withval")
 
        case "$have_python3_libdir" in
@@ -1219,7 +1247,7 @@ if test "x$have_python3" != xno; then
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to