RE: [ZODB-Dev] RE: RE: PersistentMapping
[Julien] >>> I need to try that again but, if I remember correctly, without the >>> PYTHONPATH update it didn't work out for me. [Tim] >> Works for me ;-) A possible difference is that you stuffed ZODB/src at >> the front of PYTHONPATH, but test.py appends ZODB/src to the end of >> sys.path. If you have other ZODB or Zope code on sys.path (I never do >> when I run ZODB tests), your way might be effective at "hiding" the >> installed code from ZODB's test.py. I'm not sure. >> >> Please figure out whether that's the case in the way you run this stuff. >> If it is, ZODB's test.py could be changed to "prepend" ZODB/src instead. [Julien] > Still doesn't work. AFAICT, everything you said after his demonstrated that "prepending" (as opposed to appending) the path _did_ work for you. So I'll assume this is just miscommunication. > Here is the exact set of commands : > > [EMAIL PROTECTED] tmp]$ echo $PYTHONPATH > > [EMAIL PROTECTED] tmp]$ svn co svn+ssh://[EMAIL PROTECTED]/repos/main/ZODB/trunk/ ZODB > > [...] > > Checked out external at revision 40348. > > Checked out revision 40348. > [EMAIL PROTECTED] tmp]$ cd ZODB/ > [EMAIL PROTECTED] ZODB]$ python setup.py build_ext -i > > [...] > > [EMAIL PROTECTED] ZODB]$ python test.py -v > Running tests from src > Traceback (most recent call last): > File "test.py", line 40, in ? > from zope.testing import testrunner > ImportError: cannot import name testrunner [EMAIL PROTECTED] ZODB]$ > > Then if I'm adding the src dir within the PYTHONPATH it works : > > [EMAIL PROTECTED] ZODB]$ export PYTHONPATH=`pwd`/src And this (effectively) prepends src/ to sys.path. > [EMAIL PROTECTED] ZODB]$ echo $PYTHONPATH > /tmp/ZODB/src > [EMAIL PROTECTED] ZODB]$ python test.py -v Running tests from src > Running tests at level 1 > > [...] > > I found the problem on my box. Twisted is installed on my Python version > and twisted requires zope.interface form Zope3 and this last was thus > installed on test Python I'm using to launch the ZODB tests. > > within test.py the sys.path insertion looked like this one : > > sys.path.append(src) Yes, that's what my "test.py appends ZODB/src to the end of sys.path" meant. > and then while looking for zope.testing.testrunner it couldn't be found > since the zope.interface doesn't include it. > > I changed the test.py like below so that it append the src path first in > the list of dir the interpretor should look at. > > sys.path.insert(0, path) While that's what my "ZODB's test.py could be changed to "prepend" ZODB/src instead" meant ;-) > Checked in in rev [40349] Fine by me! Thanks. ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org http://mail.zope.org/mailman/listinfo/zodb-dev
Re: [ZODB-Dev] RE: RE: PersistentMapping
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Tim, Tim Peters wrote: > >> I need to try that again but, if I remember correctly, without the >> PYTHONPATH update it didn't work out for me. > > Works for me ;-) A possible difference is that you stuffed ZODB/src at the > front of PYTHONPATH, but test.py appends ZODB/src to the end of sys.path. > If you have other ZODB or Zope code on sys.path (I never do when I run ZODB > tests), your way might be effective at "hiding" the installed code from > ZODB's test.py. I'm not sure. > > Please figure out whether that's the case in the way you run this stuff. If > it is, ZODB's test.py could be changed to "prepend" ZODB/src instead. Still doesn't work. Here is the exact set of commands : [EMAIL PROTECTED] tmp]$ echo $PYTHONPATH [EMAIL PROTECTED] tmp]$ svn co svn+ssh://[EMAIL PROTECTED]/repos/main/ZODB/trunk/ ZODB [...] Checked out external at revision 40348. Checked out revision 40348. [EMAIL PROTECTED] tmp]$ cd ZODB/ [EMAIL PROTECTED] ZODB]$ python setup.py build_ext -i [...] [EMAIL PROTECTED] ZODB]$ python test.py -v Running tests from src Traceback (most recent call last): File "test.py", line 40, in ? from zope.testing import testrunner ImportError: cannot import name testrunner [EMAIL PROTECTED] ZODB]$ Then if I'm adding the src dir within the PYTHONPATH it works : [EMAIL PROTECTED] ZODB]$ export PYTHONPATH=`pwd`/src [EMAIL PROTECTED] ZODB]$ echo $PYTHONPATH /tmp/ZODB/src [EMAIL PROTECTED] ZODB]$ python test.py -v Running tests from src Running tests at level 1 [...] I found the problem on my box. Twisted is installed on my Python version and twisted requires zope.interface form Zope3 and this last was thus installed on test Python I'm using to launch the ZODB tests. within test.py the sys.path insertion looked like this one : sys.path.append(src) and then while looking for zope.testing.testrunner it couldn't be found since the zope.interface doesn't include it. I changed the test.py like below so that it append the src path first in the list of dir the interpretor should look at. sys.path.insert(0, path) Checked in in rev [40349] Cheers, J. - -- Julien Anguenot | Nuxeo R&D (Paris, France) CPS Platform : http://www.cps-project.org Zope3 / ECM : http://www.z3lab.org mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFDhSscGhoG8MxZ/pIRAoFmAJwOdMZTXlMFWH6VcffvXsGuiV9X8gCaAgli hfZhupidLC+vSAwHnaai60A= =jSm7 -END PGP SIGNATURE- ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org http://mail.zope.org/mailman/listinfo/zodb-dev
RE: [ZODB-Dev] RE: RE: PersistentMapping
[Thomas Lotze] > ZODB/branches/3.5 > My newly added tests for PersistentMapping break here; PersistentMapping > seems to lack __iter__. (PersistentMapping hadn't been tested at all > before.) The suite passes fine on the trunk and the 3.4 and 3.6 branches, > but it fails on 3.5. > > Should __iter__ be added to the 3.5 PersistentMapping, or is it missing > for a reason? Looks it got lost in the branches. PersistentMapping.__iter__ was added in ZODB 3.4.2, just this August: http://mail.zope.org/pipermail/zodb-checkins/2005-August/010225.html Log message for revision 38076: Gave PersistentMapping an __iter__ method. Also gave it some tests (it was woefully untested). ... That got merged to the trunk (at the time) right away: http://mail.zope.org/pipermail/zodb-checkins/2005-August/010226.html Looks like the 3.5 branch got overlooked. Merging rev 38076 from 3.4 branch to 3.5 branch would be fine. ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org http://mail.zope.org/mailman/listinfo/zodb-dev
[ZODB-Dev] RE: RE: PersistentMapping
Tim Peters wrote: > ZODB/branches/3.5 My newly added tests for PersistentMapping break here; PersistentMapping seems to lack __iter__. (PersistentMapping hadn't been tested at all before.) The suite passes fine on the trunk and the 3.4 and 3.6 branches, but it fails on 3.5. Should __iter__ be added to the 3.5 PersistentMapping, or is it missing for a reason? -- Thomas ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org http://mail.zope.org/mailman/listinfo/zodb-dev
RE: [ZODB-Dev] RE: RE: PersistentMapping
[Julien] > Well I'm not sure it works Tim. My comment was to be able to test the > build *before* installing the ZODB on the Python. Right, and that's the way ZODB tests are normally run by everyone who works on ZODB (they never _install_ ZODB to run tests). > I need to try that again but, if I remember correctly, without the > PYTHONPATH update it didn't work out for me. Works for me ;-) A possible difference is that you stuffed ZODB/src at the front of PYTHONPATH, but test.py appends ZODB/src to the end of sys.path. If you have other ZODB or Zope code on sys.path (I never do when I run ZODB tests), your way might be effective at "hiding" the installed code from ZODB's test.py. I'm not sure. Please figure out whether that's the case in the way you run this stuff. If it is, ZODB's test.py could be changed to "prepend" ZODB/src instead. >> BTW, >> >> setup.py build >> python test.py >> >> should work too; it's a bug that it doesn't (and it worked fine within >> the last few months), but I don't have time for it now. > right. See later email about that (apparently it's not intended to work anymore -- this is "a zpkgtools thing"). ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org http://mail.zope.org/mailman/listinfo/zodb-dev
RE: [ZODB-Dev] RE: RE: PersistentMapping
[Tim] > ... > BTW, > > setup.py build > python test.py > > should work too; it's a bug that it doesn't (and it worked fine within > the last few months), but I don't have time for it now. Well, bug or not, the resident zpkgtools expert tells me he doesn't expect that to work anymore, and that it would take more work than _he_ has time for to try to make it work again. "setup.py build" is only "intended" to work from a distribution now, no longer from a checkout. So, README.txt should lose the parts that recommend "setup.py build"; "setup.py build_ext -i" is necessary now. ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org http://mail.zope.org/mailman/listinfo/zodb-dev
Re: [ZODB-Dev] RE: RE: PersistentMapping
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tim Peters wrote: > [Julien Anguenot] >> Note I added couple of weeks ago a comment about this within the >> README.txt of ZODB. > > I see that you also left the old instructions in README.txt on ZODB trunk, > so that anyone who reads the whole thing is left with no idea what to try > ;-) > >> """ >> To test the build, first build the externals and add the src dir to >> your PYTHONPATH, >> >> % python setup.py build_ext -i >> % export PYTHONPATH=`pwd`/src:$PYTHONPATH >> >> Then run the test script:: >> >> % python test.py >> """ > > Why are you changing PYTHONPATH? That shouldn't be needed -- test.py itself > adds "src" to sys.path (if you have done "setup.py build_ext -i" and have > not done "setup.py build"; if you do both, it has to guess, and favors the > latter). > Well I'm not sure it works Tim. My comment was to be able to test the build *before* installing the ZODB on the Python. I need to try that again but, if I remember correctly, without the PYTHONPATH update it didn't work out for me. > BTW, > > setup.py build > python test.py > > should work too; it's a bug that it doesn't (and it worked fine within the > last few months), but I don't have time for it now. > right. J. - -- Julien Anguenot | Nuxeo R&D (Paris, France) CPS Platform : http://www.cps-project.org Zope3 / ECM : http://www.z3lab.org mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFDfgXWGhoG8MxZ/pIRAuD2AJ9nAaEhE3fGlJfikFcQWS+swQ7VswCfZif3 8nYCLb1rwaXQ5LrqL/UPIkY= =dkZG -END PGP SIGNATURE- ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org http://mail.zope.org/mailman/listinfo/zodb-dev
RE: [ZODB-Dev] RE: RE: PersistentMapping
[Julien Anguenot] > Note I added couple of weeks ago a comment about this within the > README.txt of ZODB. I see that you also left the old instructions in README.txt on ZODB trunk, so that anyone who reads the whole thing is left with no idea what to try ;-) > """ > To test the build, first build the externals and add the src dir to > your PYTHONPATH, > > % python setup.py build_ext -i > % export PYTHONPATH=`pwd`/src:$PYTHONPATH > > Then run the test script:: > > % python test.py > """ Why are you changing PYTHONPATH? That shouldn't be needed -- test.py itself adds "src" to sys.path (if you have done "setup.py build_ext -i" and have not done "setup.py build"; if you do both, it has to guess, and favors the latter). BTW, setup.py build python test.py should work too; it's a bug that it doesn't (and it worked fine within the last few months), but I don't have time for it now. ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org http://mail.zope.org/mailman/listinfo/zodb-dev
Re: [ZODB-Dev] RE: RE: PersistentMapping
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tim Peters wrote: > So I tried that just now using ZODB trunk. It failed too, but with > different symptoms than you're describing: > > $ python2.4 setup.py build > ... > $ python2.4 test.py -v > Running tests from build/lib.linux-i686-2.4 > Traceback (most recent call last): > File "test.py", line 40, in ? > from zope.testing import testrunner > ImportError: No module named zope.testing > $ > > I never do "setup.py build" myself, so I was only mildly surprised by that. > It should probably be fixed ;-) Note I added couple of weeks ago a comment about this within the README.txt of ZODB. """ To test the build, first build the externals and add the src dir to your PYTHONPATH, % python setup.py build_ext -i % export PYTHONPATH=`pwd`/src:$PYTHONPATH Then run the test script:: % python test.py """ Cheers, J. - -- Julien Anguenot | Nuxeo R&D (Paris, France) CPS Platform : http://www.cps-project.org Zope3 / ECM : http://www.z3lab.org mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFDffbbGhoG8MxZ/pIRAmLCAJ9Pjq4FqgbHIOI11V5zyfjONf3xMACfbEmO RV9RuLydwQvLEz/VAUZT2k4= =vNBY -END PGP SIGNATURE- ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org http://mail.zope.org/mailman/listinfo/zodb-dev
RE: [ZODB-Dev] RE: RE: PersistentMapping
[Thomas Lotze] > OK. Right now I have the problem of getting the tests to pass before I > start changing things. Doing just as README.txt says (python2.4 setup.py > build, then python2.4 test.py) earns me waggon loads of errors which > almost entirely seem to stem from the fact that the transaction module is > not available. Is there a reason the module is not in build/lib.foo after > running the setup.py build? Things I can't guess include which version of ZODB you're trying this with, and exactly what the errors were. Copy+paste generally works a lot better than English paraphrasing. From the "build/lib.foo" part I guess you're running on Linux. So I tried that just now using ZODB trunk. It failed too, but with different symptoms than you're describing: $ python2.4 setup.py build ... $ python2.4 test.py -v Running tests from build/lib.linux-i686-2.4 Traceback (most recent call last): File "test.py", line 40, in ? from zope.testing import testrunner ImportError: No module named zope.testing $ I never do "setup.py build" myself, so I was only mildly surprised by that. It should probably be fixed ;-) This worked (which is what I normally do): $ python2.4 setup.py build_ext -i Running tests from src Running tests at level 1 Running unit tests: Running: .. .. .. ... . Ran 2317 tests with 0 failures and 0 errors in 169.318 seconds. $ Note that things can get really confused if you _also_ have a ZODB _installed_. I don't: $ python2.4 Python 2.4.2 (#1, Nov 2 2005, 19:41:44) [GCC 3.3.2 20031022 (Red Hat Linux 3.3.2-1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import ZODB Traceback (most recent call last): File "", line 1, in ? ImportError: No module named ZODB >>> >> If you count this as a new feature, it should only go in on the ZODB >> trunk. If you count this is a bugfix (that's my inclination), > And mine. Good! >> then it should also go in: >> >> ZODB/branches/3.4 >> ZODB/branches/3.5 >> ZODB/branches/3.6 > An almost disencouraging number of branches ;o) It should also go in the Zope-2_7-branch branch of CVS module ZODB3 (which will eventually become ZODB 3.2.11, for use in the Zope 2.7 line). >> Since the database root object under all ZODBs is of type >> PersistentMapping, and "everyone knows that", at this point I'd prefer >> to deprecate PersistentDict (under the sensible theory that there was >> never a real reason for it to exist in the ZODB 3 line). > +1 I don't know what +1 means on other lists, but on this list it means "that's such a good idea I'm going to devote my life to implementing it, and I promise to finish it before this time next week" -- thanks ;-) ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org http://mail.zope.org/mailman/listinfo/zodb-dev
[ZODB-Dev] RE: RE: PersistentMapping
Tim Peters wrote: > I'm the closest thing to a ZODB maintainer there is, and I won't object > ;-) Go for it! OK. Right now I have the problem of getting the tests to pass before I start changing things. Doing just as README.txt says (python2.4 setup.py build, then python2.4 test.py) earns me waggon loads of errors which almost entirely seem to stem from the fact that the transaction module is not available. Is there a reason the module is not in build/lib.foo after running the setup.py build? > If you count this as a new feature, it should only go in on the ZODB > trunk. If you count this is a bugfix (that's my inclination), And mine. > then it should also go in: > > ZODB/branches/3.4 > ZODB/branches/3.5 > ZODB/branches/3.6 An almost disencouraging number of branches ;o) > Since the database root object under all ZODBs is of type > PersistentMapping, and "everyone knows that", at this point I'd prefer to > deprecate PersistentDict (under the sensible theory that there was never a > real reason for it to exist in the ZODB 3 line). +1 -- Thomas ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org http://mail.zope.org/mailman/listinfo/zodb-dev