Stefan Behnel wrote:
> - Determine the package path to the currently compiled module by searching
> __init__.py files (just as it's done now)
>
> - Then add the top-level directory of this search to the import path
> automatically.
That's more or less what Pyrex is currently doing.
Something must have got lost in translation.
The key piece of code is in Main.Context:
def find_pxd_file(self, qualified_name, pos):
# Search include path for the .pxd file corresponding to the
# given fully-qualified module name.
# Will find either a dotted filename or a file in a
# package directory. If a source file position is given,
# the directory containing the source file is searched first
# for a dotted filename, and its containing package root
# directory is searched first for a non-dotted filename.
return self.search_package_directories(qualified_name, ".pxd", pos)
which is called with 'pos' containing the pathname of the
.pyx file being compiled, and search_package_directories
looks in the top-level package directory of that file before
searching the main include path.
--
Greg
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev