Re: [Metakit] Mk4py changes
After clarification on distutils-sig, I suggest the following patch -- Misha --- setup.py.orig 2003-10-01 20:34:20.0 +0100 +++ setup.py2003-10-01 20:35:21.0 +0100 @@ -162,8 +162,6 @@ author = metakit.__author__, author_email = metakit.__email__, url = metakit.__url__, - maintainer = metakit.__author__, - maintainer_email = metakit.__email__, license = metakit.__license__, keywords = ['database'], py_modules = ['metakit'], pgp0.pgp Description: PGP signature
Re: [Metakit] Mk4py changes
On Mon, Sep 29, 2003 at 01:53:58PM -0500, Nicholas Riley wrote: On Mon, Sep 29, 2003 at 06:35:35PM +0100, Mikhail Sobolev wrote: Can you please be a bit more specific: did you change the files outside of mk4py? I mean, can I just take the tree that corresponds to the python interface and build it against the library installed in my system (debian unstable)? No, the Python interface actually requires it be built from a Metakit build tree - it links directly against the individual Metakit object files, instead of against the Metakit library as a whole. So Mk4py.{so,sl,dll} ends up containing the Metakit library as well as the Python interface. This was part of the setup.py script before I changed it, so I assumed there was some good reason for it and didn't change it. Perhaps I was wrong. :) This actually were two questions :)) The first one: did you change any files outside of mk4py distribution? And the answer seems to be yes. I tried to re-built the package by replacing _only_ python directory, and it seemed to be OK (one of the changes -- src/view.cpp -- was just a cosmetic one, as for the other one -- src/column.cpp -- I took the risk of not implementing it; also I tweaked with the configure stuff directly). I did want to test, so I installed python2.3-unit package (which was not installed on my system) and replaced the regrtest.py file with the one you offer on your website. Here comes my question: the python setup.py test gave no errors. However when I came to the test subdirectory and tried to run test_string.py file directly, it gave me the attached errors. I wonder whether it's serious at all? (Sorry I do not know a lot about the testing framework implemented in Python.) -- Misha PASS: rejected {'a': 3, 'b': ''} as expected exceptions.TypeError Not a sequence PASS: rejected {'a': '\x00', 'b': 'hi\x00'} as expected exceptions.ValueError string contains embedded nulls; try 'B' type PASS: rejected {'a': 'abcdabcdabcd\x00hi', 'b': 'lo'} as expected exceptions.ValueError string contains embedded nulls; try 'B' type PASS: rejected {'a': '\x00\x00hi', 'b': 'lo'} as expected exceptions.ValueError string contains embedded nulls; try 'B' type FAIL: append {'a': u'hi there', 'b': 'hi'} got not a Python string exceptions.TypeError FAIL: append {'a': u'\u20ac', 'b': 'hi'} got not a Python string exceptions.TypeError FAIL: append {'a': u'Sample\u20acTesting', 'b': ''} got not a Python string exceptions.TypeError FAIL: append {'a': u'Sample\x00blahblah', 'b': 'yo'} got not a Python string exceptions.TypeError expected exceptions.ValueError VIEW CONTENTS: a b - --- asdasdfasdfasdfsa [EMAIL PROTECTED]@#$%^*() Hi there - --- Total: 3 rows PASS: retrieved {'a': '', 'b': ''} PASS: retrieved {'a': 'asdasdfasdfasdfsa', 'b': '[EMAIL PROTECTED]@#$%^*()'} PASS: retrieved {'a': '', 'b': '\xe2\x82\xacHi there'} Traceback (most recent call last): File test_string.py, line 31, in ? v.finished() File /var/home/mss/debian/libmetakit2.4.9.2-2.4.9.2/python/test/mktestsupport.py, line 147, in finished self.failure.assess() File /var/home/mss/debian/libmetakit2.4.9.2-2.4.9.2/python/test/mktestsupport.py, line 51, in assess raise TestFailed( test.test_support.TestFailed: 4 failures; run in verbose mode for details pgp0.pgp Description: PGP signature
Re: [Metakit] Mk4py changes
Mikhail, did you change any files outside of mk4py distribution? FYI, see http://trixie.triqs.com/pipermail/metakit/2003-September/001409.html - I posted a patch, i.e. all the differences in one file. You can see exactly what Nicholas did. -jcw ___ metakit mailing list - [EMAIL PROTECTED] http://www.equi4.com/mailman/listinfo/metakit
Re: [Metakit] Mk4py changes
On Tue, Sep 30, 2003 at 12:47:17PM +0200, Jean-Claude Wippler wrote: Mikhail, did you change any files outside of mk4py distribution? FYI, see http://trixie.triqs.com/pipermail/metakit/2003-September/001409.html - I posted a patch, i.e. all the differences in one file. You can see exactly what Nicholas did. Thanks for the link. :) Are you going to release these changes any time soon? -- Misha pgp0.pgp Description: PGP signature
Re: [Metakit] Mk4py changes
Hi, My only changes outside the Python area were not source-related, they were just build system-related. The differences you saw were most likely because you compared against the release version, whereas I had updated to the latest CVS version. On Tue, Sep 30, 2003 at 11:39:44AM +0100, Mikhail Sobolev wrote: Here comes my question: the python setup.py test gave no errors. However when I came to the test subdirectory and tried to run test_string.py file directly, it gave me the attached errors. I wonder whether it's serious at all? (Sorry I do not know a lot about the testing framework implemented in Python.) I think this may be linking against the wrong versions of some libraries; either run all.py or use make test-python or python setup.py test; don't run the test cases individually. Although the string messages you get don't look too good... -- =Nicholas Riley [EMAIL PROTECTED] | http://www.uiuc.edu/ph/www/njriley ___ metakit mailing list - [EMAIL PROTECTED] http://www.equi4.com/mailman/listinfo/metakit
Re: [Metakit] Mk4py changes
On Sat, Sep 27, 2003 at 09:03:10AM +0200, PieterB wrote: Do I need to upgrade autoconf, or should I change something? Thanks for all your effort! It would be great if the default metakit would work with Python out of the box. No, actually, I think downgrading autoconf would have worked. There were some constructs in configure.in which were deprecated and no longer worked properly, and some macros were in a place where they didn't make any sense. In particular, AC_LANG_CXX was doing something strange - not setting the executable extension, for example. Try this one: http://web.sabi.net/temp/metakit-2.4.9.2+njr2.tar.gz I built with Python support on FreeBSD 5.1 just five minutes ago and it worked. So hopefully it will for you too. :) The changed files are attached. The autogen.sh change is because install-sh copying moved into automake; it complains now that you aren't using automake, but works anyway. -- =Nicholas Riley [EMAIL PROTECTED] | http://www.uiuc.edu/ph/www/njriley autogen.sh Description: Bourne shell script dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.5) AC_INIT(Metakit, 2.4.9.2) AC_CONFIG_SRCDIR(../include/mk4.h) AC_CONFIG_AUX_DIR(scripts) AC_CONFIG_HEADER(config.h) AC_LANG(C++) # Checks for programs. AC_PROG_CXX AC_PROG_INSTALL MK_TARGETS=core MK_INSTALL=install-mk AC_ARG_WITH(python, AC_HELP_STRING([--with-python=PATH], [build the Mk4py extension for Python with headers in `PATH/include/python2.3'; install the Mk4py modules in `PATH/lib/python2.3/site-packages'. If PATH is of the form `HEADER,LIB', search for header files in HEADER, and install Mk4py in LIB. If you omit the `=PATH' part, use the standard includedir and libdir.]), [with_python=${withval}], [with_python=no]) AC_MSG_CHECKING([for Python configuration]) case $with_python in yes ) PY_INCLUDE_DIR=${prefix}/include/python2.3 PY_LIB_DIR=${prefix}/lib/python2.3/site-packages ;; no ) PY_INCLUDE_DIR=# no Python headers ;; *,* ) PY_INCLUDE_DIR=`echo $with_python | sed -e 's/,.*$//'` PY_LIB_DIR=`echo $with_python | sed -e 's/^.*,//'` ;; * ) PY_INCLUDE_DIR=$with_python/include/python2.3 PY_LIB_DIR=$with_python/lib/python2.3/site-packages ;; esac if test x$with_python = xno; then AC_MSG_RESULT(not enabled) else MK_TARGETS=$MK_TARGETS python MK_INSTALL=$MK_INSTALL install-python if test -f ${PY_INCLUDE_DIR}/Python.h ; then MK_TARGETS=$MK_TARGETS python MK_INSTALL=$MK_INSTALL install-python AC_MSG_RESULT($PY_INCLUDE_DIR and $PY_LIB_DIR) OLD_CPPFLAGS=$CPPFLAGS CPPFLAGS=-I$PY_INCLUDE_DIR $CPPFLAGS dnl Mk4py doesn't include config.h, so include in $CPPFLAGS AC_CHECK_HEADER(unicodeobject.h, CPPFLAGS=$OLD_CPPFLAGS -DHAVE_UNICODEOBJECT_H=1, CPPFLAGS=$OLD_CPPFLAGS) else AC_MSG_RESULT(can't find ${PY_INCLUDE_DIR}/Python.h) fi fi AC_ARG_WITH(tcl, AC_HELP_STRING([--with-tcl=PATH], [build the Mk4tcl extension for Tcl with tcl.h in `PATH/tcl.h'; install the Mk4tcl package in `PATH/../lib'. If PATH is of the form `HEADER,LIB', search for tcl.h in HEADER, and install Mk4tcl in LIB. If you omit the `=PATH' part, use the standard includedir and libdir.]), [with_tcl=${withval}], [with_tcl=no]) AC_MSG_CHECKING([for Tcl headers]) case $with_tcl in yes ) TCL_INCLUDE_DIR=${prefix}/include TCL_LIB_DIR=${prefix}/lib/tcl8.4 ;; no ) TCL_INCLUDE_DIR=# no Tcl headers ;; *,* ) TCL_INCLUDE_DIR=`echo $with_tcl | sed -e 's/,.*$//'` TCL_LIB_DIR=`echo $with_tcl | sed -e 's/^.*,//'` ;; * ) TCL_INCLUDE_DIR=$with_tcl TCL_LIB_DIR=$with_tcl/../lib ;; esac if test x$with_tcl = xno ; then AC_MSG_RESULT(not enabled) else MK_TARGETS=$MK_TARGETS tcl MK_INSTALL=$MK_INSTALL install-tcl if test -f ${TCL_INCLUDE_DIR}/tcl.h ; then AC_MSG_RESULT(found ${TCL_INCLUDE_DIR}/tcl.h) MK_TARGETS=$MK_TARGETS tcl MK_INSTALL=$MK_INSTALL install-tcl AC_MSG_CHECKING(for Tcl package installation location) AC_MSG_RESULT(${TCL_LIB_DIR}) else AC_MSG_ERROR([${TCL_INCLUDE_DIR} directory doesn't contain tcl.h]) fi fi AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads], [build with threads]), [threads_ok=$enableval], [threads_ok=no]) AC_MSG_CHECKING([for building with threads]) if test $threads_ok = yes; then MK_THREADS=-Dq4_MULTI AC_MSG_RESULT(yes) else MK_THREADS= AC_MSG_RESULT([no (default)]) fi # Libtool support AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL # Checks for libraries. # Checks for header files. AC_HEADER_STDC # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_CHECK_SIZEOF(long,4) AC_CHECK_TYPES(long long) # Checks for library functions. AC_CHECK_FUNCS(mmap memmove bcopy) # Deal with shared lib differences SHLIB_SUFFIX=.so MODULE_SUFFIX=.so STRIP_FLAGS= LIBTOOL_SHLIB_FLAGS= LIBTOOL_MODULE_FLAGS=-module case $build_os in darwin*)
Re: [Metakit] Mk4py changes
On Mon, Sep 29, 2003 at 01:10:22AM -0500, Nicholas Riley wrote: No, actually, I think downgrading autoconf would have worked. There were some constructs in configure.in which were deprecated and no longer worked properly, and some macros were in a place where they didn't make any sense. In particular, AC_LANG_CXX was doing something strange - not setting the executable extension, for example. Er, I meant AC_LANG_CPLUSPLUS here, not AC_LANG_CXX. Sorry. -- =Nicholas Riley [EMAIL PROTECTED] | http://www.uiuc.edu/ph/www/njriley ___ metakit mailing list - [EMAIL PROTECTED] http://www.equi4.com/mailman/listinfo/metakit
Re: [Metakit] Mk4py changes
On Mon, Sep 29, 2003 at 06:35:35PM +0100, Mikhail Sobolev wrote: Can you please be a bit more specific: did you change the files outside of mk4py? I mean, can I just take the tree that corresponds to the python interface and build it against the library installed in my system (debian unstable)? No, the Python interface actually requires it be built from a Metakit build tree - it links directly against the individual Metakit object files, instead of against the Metakit library as a whole. So Mk4py.{so,sl,dll} ends up containing the Metakit library as well as the Python interface. This was part of the setup.py script before I changed it, so I assumed there was some good reason for it and didn't change it. Perhaps I was wrong. :) Here's the build process I used on a Debian unstable system: ~/src% curl -O http://web.sabi.net/temp/metakit-2.4.9.2+njr2.tar.gz [...] ~/src% tar zxf metakit-2.4.9.2+njr2.tar.gz ~/src% cd metakit-2.4.9.2+njr2/builds ~/src/metakit-2.4.9.2+njr2/builds% python -V Python 2.3+ ~/src/metakit-2.4.9.2+njr2/builds% ../unix/configure --with-python=/usr [...] ~/src/metakit-2.4.9.2+njr2/builds% make [...] If you want to test: ~/src/metakit-2.4.9.2+njr2/builds% curl -O http://web.sabi.net/temp/regrtest.py ~/src/metakit-2.4.9.2+njr2/builds% sudo install regrtest.py /usr/lib/python2.3/test ~/src/metakit-2.4.9.2+njr2/builds% make test-python python ../unix/../python/test/all.py test_inttypes test_string test_unittest All 3 tests OK. Once you've run configure/make (with or without the --with-python option), you can also use Distutils to build. ~/src/metakit-2.4.9.2+njr2/builds% cd ../python ~/src/metakit-2.4.9.2+njr2/python% python setup.py build [...] ~/src/metakit-2.4.9.2+njr2/python% python setup.py test running test running build running build_py running build_ext running config gcc -pthread -E -I/usr/include/python2.3 -o _configtest.i _configtest.c removing: _configtest.c _configtest.i test_inttypes test_string test_unittest All 3 tests OK. Then use 'make install' and 'python setup.py install' (if you used Distutils) to install. -- =Nicholas Riley [EMAIL PROTECTED] | http://www.uiuc.edu/ph/www/njriley ___ metakit mailing list - [EMAIL PROTECTED] http://www.equi4.com/mailman/listinfo/metakit
Re: [Metakit] Mk4py changes
On Sat, Sep 27, 2003 at 01:40:04AM -0500, Nicholas Riley wrote: - FreeBSD 5.1-CURRENT, Python 2.3 - everything works, limited testing. I tried compiling it on FreeBSD 5.1 RELEASE using cd builds ; ../unix/configure and with ../unix/configure --with-python=/usr but both fail during configure. Using ../unix/configure (without params) also fails: ... checking for inline... inline checking for long... yes checking size of long... configure: error: cannot compute sizeof (long), 77 See `config.log' for more details. ... My config.log is online at http://gewis.nl/~pieterb/tmp/config.log.txt Do I need to upgrade autoconf, or should I change something? Thanks for all your effort! It would be great if the default metakit would work with Python out of the box. Pieter -- It takes longer to glue a vase together than to break one. ___ metakit mailing list - [EMAIL PROTECTED] http://www.equi4.com/mailman/listinfo/metakit
Re: [Metakit] Mk4py changes
Nicholas, Thanks for this great contribution. I'll go through this to understand all the changes. In the meantime. I'm attaching a diff with the latest code in CVS, it wasn't so hard after all, and after editing out the differences reported for auto-generated stuff such as configure, it becomes a lot easier to read through all your changes. [...] That's it. I hope these changes will make it easier for people new to Mk4py to get up and running, instead of being mired in compilation and usage problems. Thanks again - I *very* much share your concerns and appreciate your efforts to improve that side of things. Deployment hassles are the worst time-wasters ever IMO, it's worth spending all our time on (but only a few people, that is), to get better out-of-the-box solutions! -jcw njrdiffs.out.gz Description: GNU Zip compressed data