1PYTHON setup.py build_ext --inplace 2PYTHON -c "import foo" 3PYTHON -c "import a" 4 5######## setup.py ######## 6 7from Cython.Build import cythonize 8from distutils.core import setup 9 10setup( 11 ext_modules = cythonize("*.pyx"), 12) 13 14######## foo.pxd ######## 15 16cdef int bar() except * 17 18######## foo.pyx ######## 19 20cdef extern from "bar_impl.c": 21 int bar() except * 22 23######## bar_impl.c ######## 24 25static int bar() { return -1; } 26 27######## a.pyx ######## 28 29cimport cython 30from foo cimport bar 31 32assert bar() == -1 33