[Cython] [BUG] cythonize() doesn't handle relative imports

Devin Bayer l at t-0.be
Thu Nov 24 16:16:03 CET 2011


Hi. I had a bunch of trouble with the setuptools extensions, so I wanted to try the new cythonize command, but it doesn't correctly handle dependencies. I have two files:

  src/_proto.pxd, which is empty
  src/_inrdb.pyx, which contains "from _proto cimport *"

and cythonize(['src/_inrdb.pyx']) prints this "warning":

> ('missing cimport', 'src/_inrdb.pyx')
> libc.stdint
> 	_proto
> 	libc.string
> /Library/Python/2.7/site-packages/Cython-0.15.1-py2.7-macosx-10.7-intel.egg/Cython/Includes/libc/stdint.pxd
> 	/Library/Python/2.7/site-packages/Cython-0.15.1-py2.7-macosx-10.7-intel.egg/Cython/Includes/libc/string.pxd

touching src/__init__.py and changing the cimport to src._proto resolves the issue.

Thanks,
Devin


More information about the cython-devel mailing list