Discussion:
[Community] Testing Shapely with PyPy
Sean Gillies
2011-07-08 16:16:48 UTC
Permalink
Hi all,

Last night I began experimenting with PyPy and Shapely. It's cool to
see virtualenv, pip, and distribute working with PyPy. Shapely does
install on PyPy 1.5.0 (thanks, Oliver), but doesn't quite work:

(pypy-2d192eaab45f-osx64)s3:pypy-env seang$ python
Python 2.7.1 (2d192eaab45f, Jul 07 2011, 22:10:02)
[PyPy 1.5.0-alpha0 with GCC 4.0.1] on darwin
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``Duesseldorf sprint started''
from shapely.geometry import Point
/Users/seang/virtualenv/pypy-2d192eaab45f-osx64/site-packages/shapely/geos.py:96:
RuntimeWarning: C function without declared arguments called
...
File "/Users/seang/virtualenv/pypy-2d192eaab45f-osx64/site-packages/shapely/geos.py",
line 266, in __init__
self.geos_handle = self._lgeos.initGEOS_r(notice_h, error_h)
File "/Users/seang/opt/pypy-2d192eaab45f-osx64/lib_pypy/_ctypes/function.py",
line 677, in __call__
return CFuncPtr.__call__(self, *args)
File "/Users/seang/opt/pypy-2d192eaab45f-osx64/lib_pypy/_ctypes/function.py",
line 336, in __call__
newargs, argtypes, outargs = self._convert_args(argtypes, args, kwargs)
File "/Users/seang/opt/pypy-2d192eaab45f-osx64/lib_pypy/_ctypes/function.py",
line 535, in _convert_args
raise ArgumentError(str(e))
ArgumentError: expected c_void_p instance instead of CFunctionType

It seems like this may be one of the limitations noted at

http://codespeak.net/pypy/dist/pypy/doc/ctypes-implementation.html#discussion-and-limitations

Anybody else been trying our software with PyPy?
--
Sean
Christian Ledermann
2011-07-08 16:21:03 UTC
Permalink
I am using the shapely pypi version for over a year now (with plone buildouts).
I never had any problems.
Post by Sean Gillies
Hi all,
Last night I began experimenting with PyPy and Shapely. It's cool to
see virtualenv, pip, and distribute working with PyPy. Shapely does
(pypy-2d192eaab45f-osx64)s3:pypy-env seang$ python
Python 2.7.1 (2d192eaab45f, Jul 07 2011, 22:10:02)
[PyPy 1.5.0-alpha0 with GCC 4.0.1] on darwin
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``Duesseldorf sprint started''
from shapely.geometry import Point
RuntimeWarning: C function without declared arguments called
...
File "/Users/seang/virtualenv/pypy-2d192eaab45f-osx64/site-packages/shapely/geos.py",
line 266, in __init__
? ?self.geos_handle = self._lgeos.initGEOS_r(notice_h, error_h)
?File "/Users/seang/opt/pypy-2d192eaab45f-osx64/lib_pypy/_ctypes/function.py",
line 677, in __call__
? ?return CFuncPtr.__call__(self, *args)
?File "/Users/seang/opt/pypy-2d192eaab45f-osx64/lib_pypy/_ctypes/function.py",
line 336, in __call__
? ?newargs, argtypes, outargs = self._convert_args(argtypes, args, kwargs)
?File "/Users/seang/opt/pypy-2d192eaab45f-osx64/lib_pypy/_ctypes/function.py",
line 535, in _convert_args
? ?raise ArgumentError(str(e))
ArgumentError: expected c_void_p instance instead of CFunctionType
It seems like this may be one of the limitations noted at
?http://codespeak.net/pypy/dist/pypy/doc/ctypes-implementation.html#discussion-and-limitations
Anybody else been trying our software with PyPy?
--
Sean
_______________________________________________
Community mailing list
Community at lists.gispython.org
http://lists.gispython.org/mailman/listinfo/community
--
Best Regards,

Christian Ledermann

Nairobi - Kenya
Mobile : +254 702978914

<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don?t drive species to extinction

2) Don?t destroy a habitat that species rely on.

3) Don?t change the climate in ways that will result in the above.

}<(((*>
Oliver Tonnhofer
2011-07-08 17:15:20 UTC
Permalink
Post by Christian Ledermann
I am using the shapely pypi version for over a year now (with plone buildouts).
I never had any problems.
It's about pypY and not pypI, a small but significant difference :)
Oliver Tonnhofer
2011-07-08 17:14:21 UTC
Permalink
Hi Sean,
Post by Sean Gillies
Last night I began experimenting with PyPy and Shapely. It's cool to
see virtualenv, pip, and distribute working with PyPy. Shapely does
Are you sure you have all my changes from github?
Post by Sean Gillies
(pypy-2d192eaab45f-osx64)s3:pypy-env seang$ python
[...]
ArgumentError: expected c_void_p instance instead of CFunctionType
PyPy's ctypes is a bit more picky and it wants real function declarations instead of void pointers. Look at this changeset how do do this: https://github.com/olt/shapely/commit/74c25d06e9a82a5083e598d04cf5c73ea3e5fd3d
Maybe I missed something.

Regards,
Oliver
Sean Gillies
2011-07-08 17:47:44 UTC
Permalink
Post by Oliver Tonnhofer
Hi Sean,
Post by Sean Gillies
Last night I began experimenting with PyPy and Shapely. It's cool to
see virtualenv, pip, and distribute working with PyPy. Shapely does
Are you sure you have all my changes from github?
Post by Sean Gillies
(pypy-2d192eaab45f-osx64)s3:pypy-env seang$ python
[...]
ArgumentError: expected c_void_p instance instead of CFunctionType
PyPy's ctypes is a bit more picky and it wants real function declarations instead of void pointers. Look at this changeset how do do this: https://github.com/olt/shapely/commit/74c25d06e9a82a5083e598d04cf5c73ea3e5fd3d
Maybe I missed something.
No, it was me that missed a commit. I've pulled to get current and it
seems to work fine :)
--
Sean
Loading...