[Cython] missing cimport in module '.' - bug?

Christoph Groth christoph at grothesque.org
Tue May 3 10:19:14 EDT 2016


Hello,

The setup.py script of our package "kwant" uses Cython.Build.cythonize.
Everything works well, except that for pyx files that cimport a module
from "." an error message is generated.  E.g. for the file
"kwant/linalg/lapack.pyx" that contains the line

from . cimport f_lapack

The following message appears whenever setup.py is run:

missing cimport in module '.': kwant/linalg/lapack.pyx

No error message appears for files that cimport only from somewhere else
than ".", e.g.:

from .defs cimport gint

The said messages do not seem to cause any problems, but they are of
course somewhat of a nuiscance.  They seem to be created by
Cython.Build.Dependencies.cimported_files().  The culprit seems to be
the function find_pxd in that module that does not seem to handle
properly the case when module is ".".

To check out the problem, download "kwant" from PyPI and execute, for
example, "./setup.py --help".

Cheers,
Christoph



More information about the cython-devel mailing list