Hi, I've got a small problem with the C extension feature. It happens when your C (or Pyrex) extension is spread across several C sources, and you have a custom .h file to make the glue. Say: setup( ... ext_modules = [ Extension('mycext', [ 'src/custom1.c', 'src/custom2.c', ], include_dirs=['src']), ] Let's say custom1.c and custom2.c both include src/custom.h. The problem is when you only change src/custom.h without changing one of the C files. Setuptools does not know that custom.h is part of the C extension code, thus "setup.py build" doesn't rebuild it. Even trying "setup.py clean build" does not result into an actual rebuild. Also, including "src/custom.h" into the extension file list does not work, setuptools complaining that it doesn't know about ".h" files. Is there a clean way to have setuptools do a rebuild when the .h file is changed? Thanks, Antoine.
On Monday, November 27, 2006, at 03:01PM, "Antoine Pitrou" <antoine.pitrou@wengo.fr> wrote:
Is there a clean way to have setuptools do a rebuild when the .h file is changed?
In recent versions of python (at least 2.4, maybe also 2.3) there's an "depends" argument for Extension where you can list dependencies. Ronald
Le lundi 27 novembre 2006 à 06:04 -0800, Ronald Oussoren a écrit :
Is there a clean way to have setuptools do a rebuild when the .h file is changed?
In recent versions of python (at least 2.4, maybe also 2.3) there's an "depends" argument for Extension where you can list dependencies.
Thanks for the tip ! Antoine.
participants (2)
-
Antoine Pitrou -
Ronald Oussoren