Cython + setuptools not working with .pyx,only with .c-files

Diez B. Roggisch deets at nospam.web.de
Thu Aug 6 12:38:39 CEST 2009


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


objs = [...] # a static lib I want to wrap

setup(
    name='MyExtension',
    version="0.1",
    description='',
    author='Diez B. Roggisch',
    author_email='...',
    cmdclass = {'build_ext': build_ext},
    ext_modules = [Extension("myextension", ["myextension.pyx"],
                             libraries=["crypto"],
                             extra_objects = objs)],

-----


I can of course check in the myextension.c-file , and then when actually
working on the extension create it new by uncommenting the above lines.

But I guess that's not really the way things should work...

Diez



More information about the Python-list mailing list