[Pyrex] cimport across directories
Greg Ewing
greg.ewing at canterbury.ac.nz
Fri Jun 16 04:35:59 UTC 2006
Martin Albrecht wrote:
> I believe to have found and fixed a bug in Pyrex which prevented cimporting
> modules across directory borders. This issue has been discussed on this list
> a while back [2]: The problem seems to boil down to: either Pyrex cannot find
> the pxd file or python cannot find the module at run time.
This isn't a bug. You need to name the .pyx and .pxd files
using the full dotted name that the module will eventually
have in the package hierarchy. For example, a module called
spam that will reside in a package called foo should have
source files named "foo.spam.pyx" and "foo.spam.pxd".
This is not officially documented yet, because I haven't
decided on the best way of dealing with the issue. But that's
how it currently works.
> I fixed the later one which was due to the fact that the dots where not
> replaced by directory delimiters so search_include_directories() can handle
> the filename.
I wouldn't recommend changing that, because I can't be sure
it won't have some other undesirable effect. It's safer to
use the naming scheme described above.
--
Greg
More information about the Pyrex
mailing list