How to ship Cython pxd header files and other auxiliary files #684
-
Cython Option 1: Option 2: Thanks for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
If you want to install data files (e.g., For the second part: the reason you need to move
|
Beta Was this translation helpful? Give feedback.
If you want to install data files (e.g.,
.pxd
headers), thenpy.install_sources
is indeed the easiest way.For the second part: the reason you need to move
.pxd
files and__init__.py
files to a build directory is that Cython looks at those by default to determine the correct name for the extension module it is building. There are two options to fix this:fs.copyfile
, as you pointed out. It's not an either/or withpy.install_sources
, you can use both (don't useinstall: true
forfs.copyfile
). We do this in SciPy.cython
takes a--module-name
argument, which you can use to tell it the extension name (e.g., scipy.linalg._matfucs`); this should prevent Cython from trying to walk the director…