Commit 60cdf35f authored by Bradley M. Froehle's avatar Bradley M. Froehle

FIX: prevent missing cimport warnings when using cythonize.

The `cython` package fakes several sub-modules, including
`cython.operator` and `cython.view`. Since the `cythonize` command
cannot find a corresponding pxd file for these modules, it prints
a warning. To fix this, we exclude all modules in the `cython`
namespace when checking for missing pxd files.
parent dd08f821
...@@ -346,9 +346,9 @@ class DependencyTree(object): ...@@ -346,9 +346,9 @@ class DependencyTree(object):
self_pxd = [filename[:-4] + '.pxd'] self_pxd = [filename[:-4] + '.pxd']
else: else:
self_pxd = [] self_pxd = []
a = self.cimports(filename) a = list(x for x in self.cimports(filename) if x.split('.')[0] != 'cython')
b = filter(None, [self.find_pxd(m, filename) for m in self.cimports(filename)]) b = filter(None, [self.find_pxd(m, filename) for m in self.cimports(filename)])
if len(a) - int('cython' in a) != len(b): if len(a) != len(b):
print("missing cimport", filename) print("missing cimport", filename)
print("\n\t".join(a)) print("\n\t".join(a))
print("\n\t".join(b)) print("\n\t".join(b))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment