He tenido tantos problemas con setuptools que ya no es divertido. Así es como terminé teniendo que usar una solución alternativa para producir una distribución de fuente de trabajo con archivos de encabezado: utilicé package_data.
Lo estoy compartiendo con el fin de salvar potencialmente a alguien más el agravante. Si conoce una solución de trabajo mejor, hágamelo saber.
Ver aquí para más detalles: https://bitbucket.org/blais/beancount/src/ccb3721a7811a042661814a6778cca1c42433d64/setup.py?fileviewer=file-view-default#setup.py-36
# A note about setuptools: It's profoundly BROKEN.
#
# - The header files are needed in order to distribution a working
# source distribution.
# - Listing the header files under the extension "sources" fails to
# build; distutils cannot make out the file type.
# - Listing them as "headers" makes them ignored; extra options to
# Extension() appear to be ignored silently.
# - Listing them under setup()'s "headers" makes it recognize them, but
# they do not get included.
# - Listing them with "include_dirs" of the Extension fails as well.
#
# The only way I managed to get this working is by working around and
# including them as "packaged data" (see {63fc8d84d30a} below). That
# includes the header files in the sdist, and a source distribution can
# be installed using pip3 (and be built locally). However, the header
# files end up being installed next to the pure Python files in the
# output. This is the sorry situation we're living in, but it works.
Hay un ticket correspondiente en mi proyecto OSS: https://bitbucket.org/blais/beancount/issues/72
intentar importar setuptools en lugar de distutils.core. Entonces creo que recogerá los archivos de encabezado automáticamente. Si eso no funciona, agregue MANIFEST.in como a continuación –