Hi, if you want to get many bugreports, here's how. :) $ git clone git://git.sympy.org/sympy.git $ cd sympy $ python
import sympy sympy.test("sympy/core") [...] ============ tests finished: 292 passed, 9 xfailed in 1.40 seconds ============= True
This works in python2.4, python2.5 (there are some failures in python2.6) and it *doesn't* require py.test, just pure python. Now try pypy: $ ../pypy-dist/pypy-c # compile pypy to C and then to executable Python 2.4.1 (pypy 1.0.0 build 58853) on linux2 Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``don't post links to patents here''
import sympy sympy.test("sympy/core") [ dozens pages of errors ]
To ease debugging, use bin/test: $ ../pypy-dist/pypy-c bin/test sympy/core/ and use it like py.test. Basically, most of them reduce to this problem: $ python Python 2.4.5 (#2, Sep 29 2008, 15:31:42) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.
from sympy import Function f = Function("f")
$ ../pypy-dist/pypy-c Python 2.4.1 (pypy 1.0.0 build 58853) on linux2 Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``things will be nice and stuff''
from sympy import Function f = Function("f") [boom ...] l.append(iter_copy(i)) File "/home/ondra/repos/sympy/sympy/core/multidimensional.py", line 43, in iter_copy l.append(iter_copy(i)) File "/home/ondra/repos/sympy/sympy/core/multidimensional.py", line 43, in iter_copy l.append(iter_copy(i)) File "/home/ondra/repos/sympy/sympy/core/multidimensional.py", line 42, in iter_copy if hasattr(i, "__iter__"): RuntimeError: internal error: <RuntimeError object at 0xb03b60>
Ondrej
On Thu, Oct 9, 2008 at 2:19 AM, Ondrej Certik <ondrej@certik.cz> wrote:
Hi,
if you want to get many bugreports, here's how. :)
$ git clone git://git.sympy.org/sympy.git $ cd sympy $ python
import sympy sympy.test("sympy/core") [...] ============ tests finished: 292 passed, 9 xfailed in 1.40 seconds ============= True
This works in python2.4, python2.5 (there are some failures in python2.6) and it *doesn't* require py.test, just pure python.
Holger asked me why we are not using py.test anymore and any particular feedback. I am not subscribed to py-dev, so I just post it here. We still use py.test. But I also want to have something simple (current implementation has 335 lines) that we can include with sympy, because py.test is not so easy to install --- you need to install setuptools, which in particular require python to be compiled with zlib. So while py.test is fine let's say in Debian or Ubuntu, it was quite a pain for me to install it 6x on our buildbots: http://buildbot.sympy.org/waterfall (E.g. I compiled python2.4, 2.5, 2.6 from python.org, then I realized that setuptools cannot be installed, because python didn't compile with the zlib module, because I didn't have the zlib-dev Debian package installed, so I fixed that, recompiled python, installed setuptools 6x and then installed py.test 6x). And we are also porting sympy to jython and it's just easier to just install sympy and do "sympy.test()" to test that all is ok. We also thought we could just include py.test in sympy, but py.test depends on the py lib and it is big. So I just rewrote the necessary thing from scratch and it can do what I want. Ondrej
Hi Ondrej, On Fri, Oct 10, 2008 at 13:12 +0200, Ondrej Certik wrote:
On Thu, Oct 9, 2008 at 2:19 AM, Ondrej Certik <ondrej@certik.cz> wrote:
Hi,
if you want to get many bugreports, here's how. :)
$ git clone git://git.sympy.org/sympy.git $ cd sympy $ python
import sympy sympy.test("sympy/core") [...] ============ tests finished: 292 passed, 9 xfailed in 1.40 seconds ============= True
This works in python2.4, python2.5 (there are some failures in python2.6) and it *doesn't* require py.test, just pure python.
Holger asked me why we are not using py.test anymore and any particular feedback. I am not subscribed to py-dev, so I just post it here.
thanks - i am cross-posting this to py-dev.
We still use py.test. But I also want to have something simple (current implementation has 335 lines) that we can include with sympy, because py.test is not so easy to install --- you need to install setuptools, which in particular require python to be compiled with zlib. So while py.test is fine let's say in Debian or Ubuntu, it was quite a pain for me to install it 6x on our buildbots:
(E.g. I compiled python2.4, 2.5, 2.6 from python.org, then I realized that setuptools cannot be installed, because python didn't compile with the zlib module, because I didn't have the zlib-dev Debian package installed, so I fixed that, recompiled python, installed setuptools 6x and then installed py.test 6x).
Hum, that's kind of bothersome, i agree. I wonder if going away from setuptools makes sense, shouldn't be hard.
And we are also porting sympy to jython and it's just easier to just install sympy and do "sympy.test()" to test that all is ok.
right, makes sense.
We also thought we could just include py.test in sympy, but py.test depends on the py lib and it is big. So I just rewrote the necessary thing from scratch and it can do what I want.
Raymond Hettinger at some point also wrote a pytest one-file script with a subset of features. Probably providing something like that officially makes sense. Also i'd like to work a bit on minimizing py lib (i plan to factor some parts out into plugins soon) - most of it is actually used from py.test. best, holger -- collaborative expert contracting: http://merlinux.eu PyPy Python/Compiler tool chain: http://codespeak.net/pypy pylib py.test/greenlets/svn APIs: http://pylib.org
We also thought we could just include py.test in sympy, but py.test depends on the py lib and it is big. So I just rewrote the necessary thing from scratch and it can do what I want.
Raymond Hettinger at some point also wrote a pytest one-file script with a subset of features. Probably providing something like that officially makes sense. Also i'd like to work a bit on minimizing py lib (i plan to factor some parts out into plugins soon) - most of it is actually used from py.test.
Thanks for the work on py.test. The user interface is still I think the best from all the testing frameworks around. I think it's cool to have something small & simple that projects can just copy verbatim, and then full featured py.test, that one can use when it is installed. In fact, that's how I use it. Ondrej
Hi, On Thu, Oct 09, 2008 at 02:19:35AM +0200, Ondrej Certik wrote:
if hasattr(i, "__iter__"): RuntimeError: internal error: <RuntimeError object at 0xb03b60>
This occurs because our 'str' type has an '__iter__' special method. It turns out that CPython's does not. I suppose we could remove our __iter__, but I would rather suggest that sympy's code is fragile there: as soon as someone realizes that in CPython it is possible to speed up iteration over strings by creating a stringiterator type, then CPython will grow a 'str.__iter__' as well, and the same infinite recursion will occur in sympy... A cleaner way to say "is x iterable?" would be to try to call iter(x) and see if it raises TypeError or not. A bientot, Armin
On Sat, Oct 11, 2008 at 7:34 PM, Armin Rigo <arigo@tunes.org> wrote:
Hi,
On Thu, Oct 09, 2008 at 02:19:35AM +0200, Ondrej Certik wrote:
if hasattr(i, "__iter__"): RuntimeError: internal error: <RuntimeError object at 0xb03b60>
This occurs because our 'str' type has an '__iter__' special method. It turns out that CPython's does not. I suppose we could remove our __iter__, but I would rather suggest that sympy's code is fragile there: as soon as someone realizes that in CPython it is possible to speed up iteration over strings by creating a stringiterator type, then CPython will grow a 'str.__iter__' as well, and the same infinite recursion will occur in sympy...
A cleaner way to say "is x iterable?" would be to try to call iter(x) and see if it raises TypeError or not.
Indeed, thanks very much for the tip. We'll fix that, that's definitely something that should be fixed in sympy, I created a new issue for that: http://code.google.com/p/sympy/issues/detail?id=1153 Ondrej
participants (3)
-
Armin Rigo -
holger krekel -
Ondrej Certik