The question seems long, but it all comes down to how I can add header files to specific extension specification.
The motivation is that if I change one of the header files, issuing
python setup.py build
should rebuild the extension even when none of the .c files are changed.
I've tried to add the depending header files in "sources" keyword arg in the Extension constructor, but running the resulting setup.py generated errors complaining about unknown file extension ".h".
Thanks!
Most Python users will not want to use this module directly, but instead use the cross-version tools maintained by the Python Packaging Authority. In particular, setuptools is an enhanced alternative to distutils that provides: support for declaring project dependencies.
The header files are typically installed with Python. On Unix, these are located in the directories prefix/include/pythonversion/ and exec_prefix/include/pythonversion/ , where prefix and exec_prefix are defined by the corresponding parameters to Python's configure script and version is '%d.
The setup.py file may be the most significant file that should be placed at the root of the Python project directory. It primarily serves two purposes: It includes choices and metadata about the program, such as the package name, version, author, license, minimal dependencies, entry points, data files, and so on.
Take a look at the depends
option on the Extension
class. I've not used it myself, but your exact example is listed as a use-case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With