Skip to content

How to ship Cython pxd header files and other auxiliary files #684

Answered by rgommers
tobiasdiez asked this question in Q&A
Discussion options

You must be logged in to vote

If you want to install data files (e.g., .pxd headers), then py.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:

  1. fs.copyfile, as you pointed out. It's not an either/or with py.install_sources, you can use both (don't use install: true for fs.copyfile). We do this in SciPy.
  2. 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…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tobiasdiez
Comment options

@rgommers
Comment options

Answer selected by tobiasdiez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants