Re: Cython + setuptools not working with .pyx,only with .c-files
Stefan Behnel wrote: Diez B. Roggisch wrote: I'm trying to build a Cython-extension as Egg. However, this doesn't work - I can either use distutils to build the extension, creating a myextension.c-file on the way. If that's there, I can use setuptools to build the egg. But when I remove the .c-file, the .pyx-file isn't used to re-generate it. setuptools monkeypatch into distutils to support Pyrex if it's installed, but most non-bleeding-edge versions do not know about Cython and thus break the Cython distutils support when Pyrex isn't there as well. What helps is to put a fake Pyrex installation into your sys.path, like http://codespeak.net/svn/lxml/trunk/fake_pyrex/ as done at the top of http://codespeak.net/svn/lxml/trunk/setup.py Thanks, that did the trick for us. Diez -- http://mail.python.org/mailman/listinfo/python-list
Re: Cython + setuptools not working with .pyx,only with .c-files
David Cournapeau schrieb: On Thu, Aug 6, 2009 at 7:38 PM, Diez B. Roggischde...@nospam.web.de wrote: Hi, I'm trying to build a Cython-extension as Egg. However, this doesn't work - I can either use distutils to build the extension, creating a myextension.c-file on the way. If that's there, I can use setuptools to build the egg. But when I remove the .c-file, the .pyx-file isn't used to re-generate it. This is my setup.py: import os import glob from setuptools import setup, Extension #from distutils.core import setup #from distutils.extension import Extension from Cython.Distutils import build_ext What happens if you import setuptools *after* Cython.distutils ? My guess - I could be wrong - is that both Cython.distutils and setuptools monkey-patch distutils, and that setuptools does not see Cython.Distutils. It could also be an incompatibility between Cython.Distutils and setuptools (the design of distutils forces you to take into account the details of things modified by every distutils extension). Tried that, nothing changed :( Diez -- http://mail.python.org/mailman/listinfo/python-list
Re: Cython + setuptools not working with .pyx,only with .c-files
On Fri, Aug 7, 2009 at 7:09 PM, Diez B. Roggischde...@nospam.web.de wrote: Tried that, nothing changed :( Then you will have to modify Cython.Distutils to be aware of setuptools, I think (and soon Distribute... ). David -- http://mail.python.org/mailman/listinfo/python-list
Re: Cython + setuptools not working with .pyx,only with .c-files
Diez B. Roggisch wrote: I'm trying to build a Cython-extension as Egg. However, this doesn't work - I can either use distutils to build the extension, creating a myextension.c-file on the way. If that's there, I can use setuptools to build the egg. But when I remove the .c-file, the .pyx-file isn't used to re-generate it. setuptools monkeypatch into distutils to support Pyrex if it's installed, but most non-bleeding-edge versions do not know about Cython and thus break the Cython distutils support when Pyrex isn't there as well. What helps is to put a fake Pyrex installation into your sys.path, like http://codespeak.net/svn/lxml/trunk/fake_pyrex/ as done at the top of http://codespeak.net/svn/lxml/trunk/setup.py I haven't tried if newer setuptools versions have been fixed yet. Stefan -- http://mail.python.org/mailman/listinfo/python-list
Re: Cython + setuptools not working with .pyx,only with .c-files
On Thu, Aug 6, 2009 at 7:38 PM, Diez B. Roggischde...@nospam.web.de wrote: Hi, I'm trying to build a Cython-extension as Egg. However, this doesn't work - I can either use distutils to build the extension, creating a myextension.c-file on the way. If that's there, I can use setuptools to build the egg. But when I remove the .c-file, the .pyx-file isn't used to re-generate it. This is my setup.py: import os import glob from setuptools import setup, Extension #from distutils.core import setup #from distutils.extension import Extension from Cython.Distutils import build_ext What happens if you import setuptools *after* Cython.distutils ? My guess - I could be wrong - is that both Cython.distutils and setuptools monkey-patch distutils, and that setuptools does not see Cython.Distutils. It could also be an incompatibility between Cython.Distutils and setuptools (the design of distutils forces you to take into account the details of things modified by every distutils extension). cheers, David -- http://mail.python.org/mailman/listinfo/python-list