""" CYTHONIZE -M foo.pyx PYTHON check.py """ ######## foo.pyx ######## from bar cimport empty include "baz.pxi" empty() print(foo()) ######## baz.pxi ######## from cython.cimports.libc.math import sin def foo(): return "foo" print(sin(0)) ######## bar.pxd ######## cdef inline void empty(): print("empty") ######## check.py ######## with open("foo.c.dep", "r") as f: contents = f.read().replace("\\\n", " ").replace('\\', '/').replace('../', '') assert sorted(contents.split()) == [ 'Cython/Includes/libc/math.pxd', 'bar.pxd', 'baz.pxi', 'foo.c:', 'foo.pyx'], contents