Re: [Zope-dev] zope.index 3.5.2 broken
Hey, Andreas Jung wrote: [snip] > The diff between 3.5.1 and 3.5.2 is pretty long and substantial. I doubt > that such a major change us ok as a bugfix release. I should have become > a new major release. From what you say, agreed. Regards, Martijn ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
* Andreas Jung [2009-08-03 20:21]: > On 03.08.09 20:15, Chris McDonough wrote: >> On 8/3/09 1:07 PM, Shane Hathaway wrote: >>> Marius Gedminas wrote: On Sun, Aug 02, 2009 at 08:48:24PM +0200, Andreas Jung wrote: > the doctests for zope.index 3.5.2 - as used in Zope 2.12 - fail badly: Python's string hashes return different valuesfor half of all the strings on 64-bit machines. This influences the ordering of dictionary keys and some other things too (such as the sequence of random numbers you get if you use a string as the seed). > > Is there a buildbot for the zope.* or ZTK packages testing them under Linux > 32bit and 64 bit? AFAICS all three buildbots listed on http://docs.zope.org/zopetoolkit/process/tools.html do. Wolfgang ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
On 8/3/09 2:34 PM, Shane Hathaway wrote: > Chris McDonough wrote: >> On 8/3/09 1:07 PM, Shane Hathaway wrote: >>> How insane were these tests? Well, the author of the tests noticed that >>> the C optimization produces different scores than the Python version, >>> and compensated for that in a way that dramatically reduced readability. >> >> /me hangs head in shame. > > That was you? Well, it could have been worse. :-) I didn't write the original tests but I did paper over the okascore result differences by making the tests compare true or false vs. the expected output. Ten lashes. - C ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
Chris McDonough wrote: > On 8/3/09 1:07 PM, Shane Hathaway wrote: >> How insane were these tests? Well, the author of the tests noticed that >> the C optimization produces different scores than the Python version, >> and compensated for that in a way that dramatically reduced readability. > > /me hangs head in shame. That was you? Well, it could have been worse. :-) Shane ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
On 03.08.09 20:15, Chris McDonough wrote: > On 8/3/09 1:07 PM, Shane Hathaway wrote: > >> Marius Gedminas wrote: >> >>> On Sun, Aug 02, 2009 at 08:48:24PM +0200, Andreas Jung wrote: >>> Hi, the doctests for zope.index 3.5.2 - as used in Zope 2.12 - fail badly: File "/home/ajung/.buildout/eggs/zope.index-3.5.2-py2.6-linux-x86_64.egg/zope/index/text/tests/../textindex.txt", line 143, in textindex.txt Failed example: [(k, "%.4f" % v) for (k, v) in index2.apply("Zorro").items()] == result >>> I'm assuming items() returns a plain Python dictionary with string keys. >>> >>> Python's string hashes return different valuesfor half of all the strings >>> on 64-bit machines. This influences the ordering of dictionary keys and >>> some other things too (such as the sequence of random numbers you get if >>> you use a string as the seed). >>> >>> Add a sorted() on both sides and the test should pass. >>> >> Actually, those tests were plain insane and I've fixed them on the >> trunk. I intend to make a new zope.index release today. >> >> How insane were these tests? Well, the author of the tests noticed that >> the C optimization produces different scores than the Python version, >> and compensated for that in a way that dramatically reduced readability. >> Is there a buildbot for the zope.* or ZTK packages testing them under Linux 32bit and 64 bit? Andreas begin:vcard fn:Andreas Jung n:Jung;Andreas org:ZOPYX Ltd. & Co. KG adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany email;internet:i...@zopyx.com title:CEO tel;work:+49-7071-793376 tel;fax:+49-7071-7936840 tel;home:+49-7071-793257 x-mozilla-html:FALSE url:www.zopyx.com version:2.1 end:vcard ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
On 8/3/09 1:07 PM, Shane Hathaway wrote: > Marius Gedminas wrote: >> On Sun, Aug 02, 2009 at 08:48:24PM +0200, Andreas Jung wrote: >>> Hi, >>> >>> the doctests for zope.index 3.5.2 - as used in Zope 2.12 - fail badly: >>> >>> File >>> "/home/ajung/.buildout/eggs/zope.index-3.5.2-py2.6-linux-x86_64.egg/zope/index/text/tests/../textindex.txt", >>> line 143, in textindex.txt >>> Failed example: >>> [(k, "%.4f" % v) for (k, v) in index2.apply("Zorro").items()] == result >> >> I'm assuming items() returns a plain Python dictionary with string keys. >> >> Python's string hashes return different valuesfor half of all the strings >> on 64-bit machines. This influences the ordering of dictionary keys and >> some other things too (such as the sequence of random numbers you get if >> you use a string as the seed). >> >> Add a sorted() on both sides and the test should pass. > > Actually, those tests were plain insane and I've fixed them on the > trunk. I intend to make a new zope.index release today. > > How insane were these tests? Well, the author of the tests noticed that > the C optimization produces different scores than the Python version, > and compensated for that in a way that dramatically reduced readability. /me hangs head in shame. - C ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
Marius Gedminas wrote: > On Sun, Aug 02, 2009 at 08:48:24PM +0200, Andreas Jung wrote: >> Hi, >> >> the doctests for zope.index 3.5.2 - as used in Zope 2.12 - fail badly: >> >> File >> "/home/ajung/.buildout/eggs/zope.index-3.5.2-py2.6-linux-x86_64.egg/zope/index/text/tests/../textindex.txt", >> line 143, in textindex.txt >> Failed example: >> [(k, "%.4f" % v) for (k, v) in index2.apply("Zorro").items()] == result > > I'm assuming items() returns a plain Python dictionary with string keys. > > Python's string hashes return different valuesfor half of all the strings > on 64-bit machines. This influences the ordering of dictionary keys and > some other things too (such as the sequence of random numbers you get if > you use a string as the seed). > > Add a sorted() on both sides and the test should pass. Actually, those tests were plain insane and I've fixed them on the trunk. I intend to make a new zope.index release today. How insane were these tests? Well, the author of the tests noticed that the C optimization produces different scores than the Python version, and compensated for that in a way that dramatically reduced readability. Furthermore, the C code was producing incorrect results due to an unsafe optimization that accidentally took 32 bits of a Python float and pretended it was an integer. The breakage only became obvious when we started taking 64 bits instead, leading to completely different results. Shane ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
On Sun, Aug 02, 2009 at 08:48:24PM +0200, Andreas Jung wrote: > Hi, > > the doctests for zope.index 3.5.2 - as used in Zope 2.12 - fail badly: > > File > "/home/ajung/.buildout/eggs/zope.index-3.5.2-py2.6-linux-x86_64.egg/zope/index/text/tests/../textindex.txt", > line 143, in textindex.txt > Failed example: > [(k, "%.4f" % v) for (k, v) in index2.apply("Zorro").items()] == result I'm assuming items() returns a plain Python dictionary with string keys. Python's string hashes return different valuesfor half of all the strings on 64-bit machines. This influences the ordering of dictionary keys and some other things too (such as the sequence of random numbers you get if you use a string as the seed). Add a sorted() on both sides and the test should pass. Marius Gedminas -- http://pov.lt/ -- Zope 3 consulting and development signature.asc Description: Digital signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
On Sun, Aug 2, 2009 at 11:35 PM, Chris McDonough wrote: > There's no way any release of Zope 2 should depend on zope.index, at least > until its index implementations are as good as the ones in Zope 2 itself. I > don't know if in the short term (for a release) that means that the Zope 2 > test regime needs to change, or if the dependencies need to be fixed, or > what. In the medium term, we should fix the dependencies obviously. Note that we only depend on zope.index via a test dependency of one of our dependencies, so anyone downloading and installing the Zope2 distribution won't actually pull in zope.index. Even running the tests for Zope2 itself won't need it. Only if you want to run the tests for all dependencies of Zope2, like we do in our core development buildout, you actually get it. Hanno ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
On 8/2/09 5:23 PM, Hanno Schlichting wrote: > On Sun, Aug 2, 2009 at 10:41 PM, Chris McDonough wrote: >> That said, why does Zope 2.1.2 use the zope.index textindex? The Zope 2 >> implementation is still very superior. > > The current policy for the test runs is to test both all direct > dependencies and all transitive dependencies including all test > dependencies on all levels. We have spent quite some time reducing the > "real" dependencies already, but the test dependencies are still in a > somewhat worse state. > > So in this case zope.app.zptpage has a code dependency on zope.index. > And zope.app.zptpage is a test dependency of a number of packages, > including zope.traversing, zope.app.exception and > zope.app.publication. OK. There's no way any release of Zope 2 should depend on zope.index, at least until its index implementations are as good as the ones in Zope 2 itself. I don't know if in the short term (for a release) that means that the Zope 2 test regime needs to change, or if the dependencies need to be fixed, or what. In the medium term, we should fix the dependencies obviously. Another immediate thing to do would just be to pin the zope.index version to 3.5.1, given that it doesn't matter one way or another whether these tests pass for purposes of a Zope 2 release. > I think it might be time to remove the test extras again for "reusable > zope.*" packages and declare them as real dependencies. This would > allow us to actually see them more easily and get truly embarrassed - > a good way of spurring motivation to fix the mess ;-) Oh good, I might win that beer from Martijn after all. ;-) - C ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
On 8/2/09 5:19 PM, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Andreas Jung wrote: >> Hi, >> >> the doctests for zope.index 3.5.2 - as used in Zope 2.12 - fail badly: >> >> File >> "/home/ajung/.buildout/eggs/zope.index-3.5.2-py2.6-linux-x86_64.egg/zope/index/text/tests/../textindex.txt", >> line 143, in textindex.txt >> Failed example: >> [(k, "%.4f" % v) for (k, v) in index2.apply("Zorro").items()] == result >> Expected: >> True >> Got: >> False >> >> Thoughts? > > Shoot that test: it sucks both as a test and as documentation. Already shot on the trunk (by Shane). - C ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
On Sun, Aug 2, 2009 at 10:41 PM, Chris McDonough wrote: > That said, why does Zope 2.1.2 use the zope.index textindex? The Zope 2 > implementation is still very superior. The current policy for the test runs is to test both all direct dependencies and all transitive dependencies including all test dependencies on all levels. We have spent quite some time reducing the "real" dependencies already, but the test dependencies are still in a somewhat worse state. So in this case zope.app.zptpage has a code dependency on zope.index. And zope.app.zptpage is a test dependency of a number of packages, including zope.traversing, zope.app.exception and zope.app.publication. I think it might be time to remove the test extras again for "reusable zope.*" packages and declare them as real dependencies. This would allow us to actually see them more easily and get truly embarrassed - a good way of spurring motivation to fix the mess ;-) Hanno ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andreas Jung wrote: > Hi, > > the doctests for zope.index 3.5.2 - as used in Zope 2.12 - fail badly: > > File > "/home/ajung/.buildout/eggs/zope.index-3.5.2-py2.6-linux-x86_64.egg/zope/index/text/tests/../textindex.txt", > line 143, in textindex.txt > Failed example: > [(k, "%.4f" % v) for (k, v) in index2.apply("Zorro").items()] == result > Expected: > True > Got: > False > > Thoughts? Shoot that test: it sucks both as a test and as documentation. Tres. - -- === Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software "Excellence by Design"http://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFKdgL4+gerLs4ltQ4RAntBAJ0eC3YcZxxDh8qw2hIRSFK2UA1Q1wCghbn+ +eMTXYnbaDt0cmHAbTyYgmY= =uVOK -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
On 8/2/09 4:41 PM, Chris McDonough wrote: > On 8/2/09 3:07 PM, Andreas Jung wrote: >> On 02.08.09 21:00, Andreas Jung wrote: >>> On 02.08.09 20:48, Andreas Jung wrote: >>> Hi, the doctests for zope.index 3.5.2 - as used in Zope 2.12 - fail badly: File "/home/ajung/.buildout/eggs/zope.index-3.5.2-py2.6-linux-x86_64.egg/zope/index/text/tests/../textindex.txt", line 143, in textindex.txt Failed example: [(k, "%.4f" % v) for (k, v) in index2.apply("Zorro").items()] == result Expected: True Got: False >>> Obviously another Python 2.5/.6 incompatiblity. zope.index 3.5.1 works fine >>> with Python 2.4-2.6 - obviously changes to okascore.c introduced with >>> zope.index >>> 3.5.2 are to blame?! >> >> The diff between 3.5.1 and 3.5.2 is pretty long and substantial. I doubt >> that such a major change us ok as a bugfix release. I should have become >> a new major release. I suggest that the current trunk should be released >> as 3.6.0 and the current 3.5.1 released should be copied to tags/3.5.3 and >> re-released. > > I think your test failure is related to a 64-bit issue. Shane has some fixes > on > the trunk that may solve this. > > That said, why does Zope 2.1.2 use the zope.index textindex? The Zope 2 > implementation is still very superior. > > Before we started fixing it, there were places that the zope.index text index > didn't actually work at all Where it did work, it worked very, very slowly. > We've been trying to improve it incrementally (mostly by backporting all the > fixes that have accreted to the Zope 2 implementation). > > I'll try to pin this down and make a 3.6.0 release, but Zope 2 shouldn't be > using this index. The tests now pass on my 32-bit machine. Can someone with a 64-bit system try them? - C ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
On 8/2/09 3:07 PM, Andreas Jung wrote: > On 02.08.09 21:00, Andreas Jung wrote: >> On 02.08.09 20:48, Andreas Jung wrote: >> >>> Hi, >>> >>> the doctests for zope.index 3.5.2 - as used in Zope 2.12 - fail badly: >>> >>> File >>> "/home/ajung/.buildout/eggs/zope.index-3.5.2-py2.6-linux-x86_64.egg/zope/index/text/tests/../textindex.txt", >>> line 143, in textindex.txt >>> Failed example: >>> [(k, "%.4f" % v) for (k, v) in index2.apply("Zorro").items()] == result >>> Expected: >>> True >>> Got: >>> False >>> >>> >>> >> Obviously another Python 2.5/.6 incompatiblity. zope.index 3.5.1 works fine >> with Python 2.4-2.6 - obviously changes to okascore.c introduced with >> zope.index >> 3.5.2 are to blame?! > > The diff between 3.5.1 and 3.5.2 is pretty long and substantial. I doubt > that such a major change us ok as a bugfix release. I should have become > a new major release. I suggest that the current trunk should be released > as 3.6.0 and the current 3.5.1 released should be copied to tags/3.5.3 and > re-released. I think your test failure is related to a 64-bit issue. Shane has some fixes on the trunk that may solve this. That said, why does Zope 2.1.2 use the zope.index textindex? The Zope 2 implementation is still very superior. Before we started fixing it, there were places that the zope.index text index didn't actually work at all Where it did work, it worked very, very slowly. We've been trying to improve it incrementally (mostly by backporting all the fixes that have accreted to the Zope 2 implementation). I'll try to pin this down and make a 3.6.0 release, but Zope 2 shouldn't be using this index. - C ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
On 02.08.09 21:00, Andreas Jung wrote: > On 02.08.09 20:48, Andreas Jung wrote: > >> Hi, >> >> the doctests for zope.index 3.5.2 - as used in Zope 2.12 - fail badly: >> >> File >> "/home/ajung/.buildout/eggs/zope.index-3.5.2-py2.6-linux-x86_64.egg/zope/index/text/tests/../textindex.txt", >> line 143, in textindex.txt >> Failed example: >> [(k, "%.4f" % v) for (k, v) in index2.apply("Zorro").items()] == result >> Expected: >> True >> Got: >> False >> >> >> > Obviously another Python 2.5/.6 incompatiblity. zope.index 3.5.1 works fine > with Python 2.4-2.6 - obviously changes to okascore.c introduced with > zope.index > 3.5.2 are to blame?! The diff between 3.5.1 and 3.5.2 is pretty long and substantial. I doubt that such a major change us ok as a bugfix release. I should have become a new major release. I suggest that the current trunk should be released as 3.6.0 and the current 3.5.1 released should be copied to tags/3.5.3 and re-released. Andreas begin:vcard fn:Andreas Jung n:Jung;Andreas org:ZOPYX Ltd. & Co. KG adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany email;internet:i...@zopyx.com title:CEO tel;work:+49-7071-793376 tel;fax:+49-7071-7936840 tel;home:+49-7071-793257 x-mozilla-html:FALSE url:www.zopyx.com version:2.1 end:vcard ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index 3.5.2 broken
On 02.08.09 20:48, Andreas Jung wrote: > Hi, > > the doctests for zope.index 3.5.2 - as used in Zope 2.12 - fail badly: > > File > "/home/ajung/.buildout/eggs/zope.index-3.5.2-py2.6-linux-x86_64.egg/zope/index/text/tests/../textindex.txt", > line 143, in textindex.txt > Failed example: > [(k, "%.4f" % v) for (k, v) in index2.apply("Zorro").items()] == result > Expected: > True > Got: > False > > Obviously another Python 2.5/.6 incompatiblity. zope.index 3.5.1 works fine with Python 2.4-2.6 - obviously changes to okascore.c introduced with zope.index 3.5.2 are to blame?! Andreas begin:vcard fn:Andreas Jung n:Jung;Andreas org:ZOPYX Ltd. & Co. KG adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany email;internet:i...@zopyx.com title:CEO tel;work:+49-7071-793376 tel;fax:+49-7071-7936840 tel;home:+49-7071-793257 x-mozilla-html:FALSE url:www.zopyx.com version:2.1 end:vcard ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index
On Tue, Dec 02, 2008 at 10:03:01PM +0100, Wichert Akkerman wrote: > Previously Marius Gedminas wrote: > > On Tue, Dec 02, 2008 at 02:04:39AM +0300, Dan Korostelev wrote: > > > I just removed zope.testing from the zope.index dependency and > > > replaced zope.testing.doctest imports with plain python doctest and it > > > seems to work with python 2.4 and 2.5 here. Now, it only depends on > > > ZODB3 and zope.interface, which is nice :) Is there any objections on > > > this? > > > > Yes. > > > > Using 'import doctest' rather than 'from zope.testing import doctest' > > was a pretty reliable way to break test.py --coverage, at least on > > Python 2.4. > > Isn't that a bug in test.py that should be fixed then? AFAIU it's a bug in Python's doctest.py that's been fixed in Zope's copy. I believe it was fixed in a newer Python version. Unfortunately, I cannot find a reference to a bug. All I remember is that I once spent a couple of days making sure test coverage worked, and the last fix was going through the source tree and replacing 'import doctest' with 'from zope.testing import doctest'. It was a long time ago, so I could be wrong about the Python version. It may have been 2.3's doctest.py that had the bug. I just diffed Zope's doctest.py with Python 2.4 and 2.5 versions, and I don't see anything that looks like a fix for tracing. (I see other differences, though, like making sure a test's globs are preserved, and a whole new feature flag INTERPRET_FOOTNOTES.) Actually, I can look at svn logs... http://zope3.pov.lt/trac/changeset/28704 http://zope3.pov.lt/trac/changeset/28705 http://mail.zope.org/pipermail/zope3-dev/2004-December/012990.html Yes, it was a bug in Python 2.3, and that fix is present in 2.4's doctest.py. Since we don't support 2.3 any more, I retract my objection to plain 'import doctest' on the grounds of coverage. Although people should be aware of the other differences between Zope's doctest and Python's doctest (unfortunate, that). Marius Gedminas -- C, n: A programming language that is sort of like Pascal except more like assembly except that it isn't very much like either one, or anything else. It is either the best language available to the art today, or it isn't. -- Ray Simard signature.asc Description: Digital signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index
On Tue, Dec 02, 2008 at 11:52:29AM -0500, Benji York wrote: > The status quo is to forgo creating extras unless there is a compelling > reason to have one. +10 -- Brian Sutherland ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index
Previously Marius Gedminas wrote: > On Tue, Dec 02, 2008 at 02:04:39AM +0300, Dan Korostelev wrote: > > I just removed zope.testing from the zope.index dependency and > > replaced zope.testing.doctest imports with plain python doctest and it > > seems to work with python 2.4 and 2.5 here. Now, it only depends on > > ZODB3 and zope.interface, which is nice :) Is there any objections on > > this? > > Yes. > > Using 'import doctest' rather than 'from zope.testing import doctest' > was a pretty reliable way to break test.py --coverage, at least on > Python 2.4. Isn't that a bug in test.py that should be fixed then? Wichert. -- Wichert Akkerman <[EMAIL PROTECTED]>It is simple to make things. http://www.wiggy.net/ It is hard to make things simple. ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index
"Benji York" <[EMAIL PROTECTED]> writes: > On Tue, Dec 2, 2008 at 6:48 AM, Dan Korostelev <[EMAIL PROTECTED]> wrote: >> 2008/12/2 Marius Gedminas <[EMAIL PROTECTED]>: >>> On Tue, Dec 02, 2008 at 02:04:39AM +0300, Dan Korostelev wrote: I just removed zope.testing from the zope.index dependency and replaced zope.testing.doctest imports with plain python doctest and it seems to work with python 2.4 and 2.5 here. Now, it only depends on ZODB3 and zope.interface, which is nice :) Is there any objections on this? >>> >>> Yes. >>> >>> Using 'import doctest' rather than 'from zope.testing import doctest' >>> was a pretty reliable way to break test.py --coverage, at least on >>> Python 2.4. >> >> Oh, thanks for the hint. I'll fix that now. :) There's no need to use >> try/except though, it's nicer just to create an extras_require for >> tests, I think. > > The status quo is to forgo creating extras unless there is a compelling > reason to have one. Creating a test extra just to remove a dependency > on zope.testing -- which only depends on zope.interface -- is not > compelling. I'd be curious, for my own edification, to hear what would be compelling reasons. Thanks! Ross ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index
On Tue, Dec 2, 2008 at 6:48 AM, Dan Korostelev <[EMAIL PROTECTED]> wrote: > 2008/12/2 Marius Gedminas <[EMAIL PROTECTED]>: >> On Tue, Dec 02, 2008 at 02:04:39AM +0300, Dan Korostelev wrote: >>> I just removed zope.testing from the zope.index dependency and >>> replaced zope.testing.doctest imports with plain python doctest and it >>> seems to work with python 2.4 and 2.5 here. Now, it only depends on >>> ZODB3 and zope.interface, which is nice :) Is there any objections on >>> this? >> >> Yes. >> >> Using 'import doctest' rather than 'from zope.testing import doctest' >> was a pretty reliable way to break test.py --coverage, at least on >> Python 2.4. > > Oh, thanks for the hint. I'll fix that now. :) There's no need to use > try/except though, it's nicer just to create an extras_require for > tests, I think. The status quo is to forgo creating extras unless there is a compelling reason to have one. Creating a test extra just to remove a dependency on zope.testing -- which only depends on zope.interface -- is not compelling. -- Benji York Senior Software Engineer Zope Corporation ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index
2008/12/2 Marius Gedminas <[EMAIL PROTECTED]>: > On Tue, Dec 02, 2008 at 02:04:39AM +0300, Dan Korostelev wrote: >> I just removed zope.testing from the zope.index dependency and >> replaced zope.testing.doctest imports with plain python doctest and it >> seems to work with python 2.4 and 2.5 here. Now, it only depends on >> ZODB3 and zope.interface, which is nice :) Is there any objections on >> this? > > Yes. > > Using 'import doctest' rather than 'from zope.testing import doctest' > was a pretty reliable way to break test.py --coverage, at least on > Python 2.4. Oh, thanks for the hint. I'll fix that now. :) There's no need to use try/except though, it's nicer just to create an extras_require for tests, I think. -- WBR, Dan Korostelev ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] zope.index
On Tue, Dec 02, 2008 at 02:04:39AM +0300, Dan Korostelev wrote: > I just removed zope.testing from the zope.index dependency and > replaced zope.testing.doctest imports with plain python doctest and it > seems to work with python 2.4 and 2.5 here. Now, it only depends on > ZODB3 and zope.interface, which is nice :) Is there any objections on > this? Yes. Using 'import doctest' rather than 'from zope.testing import doctest' was a pretty reliable way to break test.py --coverage, at least on Python 2.4. Please use try: # needed for reliable unit test coverage measurement from zope.testing import doctest except ImportError: import doctest instead. > If no, can someone make a release on PyPI of this package? Marius Gedminas -- ... there is always a well-known solution to every human problem -- neat, plausible, and wrong. -- H. L. Mencken (1880-1956), "Prejudices" signature.asc Description: Digital signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )