The following setup.py file doesn't generate the proper .c file when
running install, build, or build_ext targets:
from setuptools import setup, find_packages
from pkg_resources import require
require('Cython')
from Cython.Distutils import build_ext
from Cython.Distutils.extension import Extension
setup(
name="foo",
version="0.6.0",
author="foo",
packages=find_packages(),
entry_points={
'console_scripts': [
'foo = foo.cli:main',
],
},
scripts=["scripts/foo"],
cmdclass={'build_ext': build_ext},
ext_modules=[
Extension('bixdata.cbix',
sources=['bixdata/bixidx.c', 'bixdata/cbix.pyx'],
extra_compile_args=['-O2'],
),
],
install_requires=[
"cython >= 0.11, < 0.12",
# other stuff....
],
)
#EOF
I've added print statements in Cython.Distutils.extension.Extension to
find out that distutils.extension is turning these sources:
['bixdata/bixidx.c', 'bixdata/cbix.pyx']
...into this:
['bixdata/bixidx.c', 'bixdata/cbix.c']
Since cbix.pyx becomes cbix.c, but cython has never compiled the .pyx
into the .c file in build_ext.cython_sources. It appears distutils is
preventing cython from automatically compiling .pyx to .c.
Is there something I'm doing wrong? I've also tried using Extension
from setuptools instead of from Cython, but it doesn't seem to make
any difference.
Thanks in advance,
Michael Schurter
@schmichael
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev