Changeset: a72d771c0256 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a72d771c0256
Added Files:
clients/examples/python/basics.py
clients/examples/python/mclient-python2.py
clients/examples/python/mclient-python3.py
clients/examples/python/perf.py
sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
sql/test/mapi/Tests/python2_test_monetdb_sql.stable.err
sql/test/mapi/Tests/python2_test_monetdb_sql.stable.out
sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
sql/test/mapi/Tests/python3_test_monetdb_sql.stable.out
Removed Files:
clients/python2/examples/basics.py
clients/python2/examples/mclient.py
clients/python2/examples/perf.py
clients/python3/examples/basics.py
clients/python3/examples/mclient.py
clients/python3/examples/perf.py
sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat
sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh
sql/test/mapi/Tests/python_test_monetdb_sql.stable.err
sql/test/mapi/Tests/python_test_monetdb_sql.stable.out
Modified Files:
clients/python2/Makefile.ag
clients/python3/Makefile.ag
sql/test/mapi/Tests/All
testing/Mtest.py.in
Branch: Feb2013
Log Message:
Merged from Oct2012
diffs (272 lines):
diff --git a/clients/python2/examples/basics.py
b/clients/examples/python/basics.py
rename from clients/python2/examples/basics.py
rename to clients/examples/python/basics.py
diff --git a/clients/python2/examples/mclient.py
b/clients/examples/python/mclient-python2.py
rename from clients/python2/examples/mclient.py
rename to clients/examples/python/mclient-python2.py
--- a/clients/python2/examples/mclient.py
+++ b/clients/examples/python/mclient-python2.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
# The contents of this file are subject to the MonetDB Public License
# Version 1.1 (the "License"); you may not use this file except in
@@ -17,8 +17,6 @@
# Copyright August 2008-2012 MonetDB B.V.
# All Rights Reserved.
-#
-
import sys
import getopt
diff --git a/clients/python3/examples/mclient.py
b/clients/examples/python/mclient-python3.py
rename from clients/python3/examples/mclient.py
rename to clients/examples/python/mclient-python3.py
--- a/clients/python3/examples/mclient.py
+++ b/clients/examples/python/mclient-python3.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# The contents of this file are subject to the MonetDB Public License
# Version 1.1 (the "License"); you may not use this file except in
diff --git a/clients/python2/examples/perf.py b/clients/examples/python/perf.py
rename from clients/python2/examples/perf.py
rename to clients/examples/python/perf.py
diff --git a/clients/python2/Makefile.ag b/clients/python2/Makefile.ag
--- a/clients/python2/Makefile.ag
+++ b/clients/python2/Makefile.ag
@@ -20,4 +20,4 @@ python2_setup = {
}
EXTRA_DIST = README.rst setup.py
-EXTRA_DIST_DIR = examples monetdb test
+EXTRA_DIST_DIR = monetdb test
diff --git a/clients/python3/Makefile.ag b/clients/python3/Makefile.ag
--- a/clients/python3/Makefile.ag
+++ b/clients/python3/Makefile.ag
@@ -20,4 +20,4 @@ python3_setup = {
}
EXTRA_DIST = README.rst setup.py
-EXTRA_DIST_DIR = examples monetdb test
+EXTRA_DIST_DIR = monetdb test
diff --git a/clients/python3/examples/basics.py
b/clients/python3/examples/basics.py
deleted file mode 100644
--- a/clients/python3/examples/basics.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# The contents of this file are subject to the MonetDB Public License
-# Version 1.1 (the "License"); you may not use this file except in
-# compliance with the License. You may obtain a copy of the License at
-# http://www.monetdb.org/Legal/MonetDBLicense
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-# License for the specific language governing rights and limitations
-# under the License.
-#
-# The Original Code is the MonetDB Database System.
-#
-# The Initial Developer of the Original Code is CWI.
-# Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
-# Copyright August 2008-2012 MonetDB B.V.
-# All Rights Reserved.
-
-import logging
-
-#configure the logger, so we can see what is happening
-logging.basicConfig(level=logging.DEBUG)
-logger = logging.getLogger('monetdb')
-
-try:
- import monetdb.sql
-except ImportError:
- # running examples from development tree
- import sys
- import os
- parent = os.path.join(sys.path[0], os.pardir)
- sys.path.append(parent)
- import monetdb.sql
-
-
-x = monetdb.sql.connect(username="monetdb", password="monetdb",
hostname="localhost", database="demo")
-c = x.cursor()
-
-# some basic query
-c.arraysize=100
-c.execute('select * from tables')
-results = c.fetchall()
-x.commit()
-print(results)
diff --git a/clients/python3/examples/perf.py b/clients/python3/examples/perf.py
deleted file mode 100644
--- a/clients/python3/examples/perf.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# The contents of this file are subject to the MonetDB Public License
-# Version 1.1 (the "License"); you may not use this file except in
-# compliance with the License. You may obtain a copy of the License at
-# http://www.monetdb.org/Legal/MonetDBLicense
-#
-# Software distributed under the License is distributed on an "AS IS"
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-# License for the specific language governing rights and limitations
-# under the License.
-#
-# The Original Code is the MonetDB Database System.
-#
-# The Initial Developer of the Original Code is CWI.
-# Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
-# Copyright August 2008-2012 MonetDB B.V.
-# All Rights Reserved.
-
-
-import time
-
-#configure the logger, so we can see what is happening
-#import logging
-#logging.basicConfig(level=logging.DEBUG)
-#logger = logging.getLogger('monetdb')
-
-
-try:
- import monetdb.sql
-except ImportError:
- # running examples from development tree
- import sys
- import os
- parent = os.path.join(sys.path[0], os.pardir)
- sys.path.append(parent)
- import monetdb.sql
-
-t = time.time()
-x = monetdb.sql.connect(database="demo")
-c = x.cursor()
-c.arraysize=10000
-c.execute('select * from tables, tables')
-results = c.fetchall()
diff --git a/sql/test/mapi/Tests/All b/sql/test/mapi/Tests/All
--- a/sql/test/mapi/Tests/All
+++ b/sql/test/mapi/Tests/All
@@ -10,4 +10,5 @@ HAVE_PYTHON?python_dbapi
HAVE_GEOM&HAVE_PHP?php_monetdb
!HAVE_GEOM&HAVE_PHP?php_monetdb_nogeom
utf8test
-python_test_monetdb_sql
+HAVE_PYTHON2?python2_test_monetdb_sql
+HAVE_PYTHON3?python3_test_monetdb_sql
diff --git a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat
b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
rename from sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat
rename to sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
--- a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat
+++ b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.bat
@@ -8,4 +8,4 @@ set PYTHONPATH=%testpath%;%PYTHONPATH%
prompt # $t $g
echo on
-python "%testpath%/runtests.py"
+%PYTHON2% "%testpath%/runtests.py"
diff --git a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh
b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
rename from sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh
rename to sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
--- a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh
+++ b/sql/test/mapi/Tests/python2_test_monetdb_sql.SQL.sh
@@ -6,4 +6,4 @@ testpath="$TSTSRCBASE/../clients/python2
PYTHONPATH=$testpath:$PYTHONPATH
export PYTHONPATH
-Mlog -x "python $testpath/runtests.py"
+Mlog -x "${PYTHON2} $testpath/runtests.py"
diff --git a/sql/test/mapi/Tests/python_test_monetdb_sql.stable.err
b/sql/test/mapi/Tests/python2_test_monetdb_sql.stable.err
rename from sql/test/mapi/Tests/python_test_monetdb_sql.stable.err
rename to sql/test/mapi/Tests/python2_test_monetdb_sql.stable.err
--- a/sql/test/mapi/Tests/python_test_monetdb_sql.stable.err
+++ b/sql/test/mapi/Tests/python2_test_monetdb_sql.stable.err
@@ -1,4 +1,4 @@
-stderr of test 'python_test_monetdb_sql` in directory 'test/mapi` itself:
+stderr of test 'python2_test_monetdb_sql` in directory 'test/mapi` itself:
# 11:54:47 >
diff --git a/sql/test/mapi/Tests/python_test_monetdb_sql.stable.out
b/sql/test/mapi/Tests/python2_test_monetdb_sql.stable.out
rename from sql/test/mapi/Tests/python_test_monetdb_sql.stable.out
rename to sql/test/mapi/Tests/python2_test_monetdb_sql.stable.out
--- a/sql/test/mapi/Tests/python_test_monetdb_sql.stable.out
+++ b/sql/test/mapi/Tests/python2_test_monetdb_sql.stable.out
@@ -1,4 +1,4 @@
-stdout of test 'python_test_monetdb_sql` in directory 'test/mapi` itself:
+stdout of test 'python2_test_monetdb_sql` in directory 'test/mapi` itself:
# 11:54:47 >
diff --git a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat
b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
copy from sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat
copy to sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
--- a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.bat
+++ b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.bat
@@ -2,10 +2,10 @@
rem must be aligned with the installation directory chosen in
rem clients/python/test/Makefile.ag
-set testpath=%TSTSRCBASE%\..\clients\python2\test
+set testpath=%TSTSRCBASE%\..\clients\python3\test
set PYTHONPATH=%testpath%;%PYTHONPATH%
prompt # $t $g
echo on
-python "%testpath%/runtests.py"
+%PYTHON3% "%testpath%/runtests.py"
diff --git a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh
b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
copy from sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh
copy to sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
--- a/sql/test/mapi/Tests/python_test_monetdb_sql.SQL.sh
+++ b/sql/test/mapi/Tests/python3_test_monetdb_sql.SQL.sh
@@ -2,8 +2,8 @@
# must be aligned with the installation directory chosen in
# clients/python/test/Makefile.ag
-testpath="$TSTSRCBASE/../clients/python2/test"
+testpath="$TSTSRCBASE/../clients/python3/test"
PYTHONPATH=$testpath:$PYTHONPATH
export PYTHONPATH
-Mlog -x "python $testpath/runtests.py"
+Mlog -x "${PYTHON3} $testpath/runtests.py"
diff --git a/sql/test/mapi/Tests/python_test_monetdb_sql.stable.err
b/sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
copy from sql/test/mapi/Tests/python_test_monetdb_sql.stable.err
copy to sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
--- a/sql/test/mapi/Tests/python_test_monetdb_sql.stable.err
+++ b/sql/test/mapi/Tests/python3_test_monetdb_sql.stable.err
@@ -1,4 +1,4 @@
-stderr of test 'python_test_monetdb_sql` in directory 'test/mapi` itself:
+stderr of test 'python3_test_monetdb_sql` in directory 'test/mapi` itself:
# 11:54:47 >
diff --git a/sql/test/mapi/Tests/python_test_monetdb_sql.stable.out
b/sql/test/mapi/Tests/python3_test_monetdb_sql.stable.out
copy from sql/test/mapi/Tests/python_test_monetdb_sql.stable.out
copy to sql/test/mapi/Tests/python3_test_monetdb_sql.stable.out
--- a/sql/test/mapi/Tests/python_test_monetdb_sql.stable.out
+++ b/sql/test/mapi/Tests/python3_test_monetdb_sql.stable.out
@@ -1,4 +1,4 @@
-stdout of test 'python_test_monetdb_sql` in directory 'test/mapi` itself:
+stdout of test 'python3_test_monetdb_sql` in directory 'test/mapi` itself:
# 11:54:47 >
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1163,6 +1163,8 @@ def PerformDir(env, testdir, testlist, B
os.environ['TSTSRCDIR'] = TSTSRCDIR
os.environ['TSTTRGDIR'] = TSTTRGDIR
os.environ['RELSRCDIR'] = env['RELSRCDIR']
+ os.environ['PYTHON2'] = '@PYTHON2@'
+ os.environ['PYTHON3'] = '@PYTHON3@'
#STDERR.flush()
#for v in 'RELSRCDIR':
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list