Hi,

The manual states that "the Cython compiler searches for a file called
modulename.pxd along the search path for include files, as specified by -I
command line options" [1].

I'm wondering if there is any way to get this behavior with distutils (i.e.
from inside a setup.py script). The build_ext command doens't seem to
support using the -I option in the same way that Cython does.

$ cython -Idir foo.pyx

$ python setup_foo.py build_ext -c mingw32 -i
running build_ext
error: file 'bar.pxd' does not exist

$ mv dir/bar.pxd .

$ python setup_foo.py build_ext -c mingw32 -i
running build_ext
building 'foo' extension
... compiles successfully ...

$ cat foo.pyx
cimport bar

$ cat bar.pxd

$ cat setup_foo.py
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

setup(
    cmdclass = {'build_ext': build_ext},
    ext_modules = [Extension('foo', ['foo.pyx'])]
)

This is with Python 2.5.4, Cython 0.11.2, and MinGW from Cygwin on Windows.

Thanks.

[1]
http://docs.cython.org/docs/sharing_declarations.html#search-paths-for-definition-files

-- 
Elliott Slaughter

"Don't worry about what anybody else is going to do. The best way to predict
the future is to invent it." - Alan Kay
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to