How to have PyPI package install header files for

2019-05-23 02:18发布

问题:

We have a package (rebound) up on PyPI that includes a C extension . The relevant part of the setup.py file looks like this (simplified):

libreboundmodule = Extension('librebound',
                sources = [ 'src/rebound.c'],  
                include_dirs = ['src'],)   

Additional libraries need access to rebound.h, but when one runs

pip install rebound

it doesn't install rebound.h anywhere. How can we get distutils/setuptools to install rebound.h somewhere along with all the python modules? We're hoping that we can have pip install rebound do all the work so the user doesn't have to run any additional commands.