[Distutils] c extensions: how to rebuild and test quickly

Paul Pogonyshev pogonyshev at gmx.net
Thu Feb 15 20:43:34 CET 2007


Thomas Heller wrote:
> Paul Pogonyshev schrieb:
> > Hi,
> > 
> > Distutils create dynamic library for a C extension in `build/...'
> > directory.  This makes it impossible to run program without
> > installing it, which I find very important for developing.  Ideally,
> > process should look like this:
> > [...]
>
> What I do is to create a loader module named <extension>.py that  
> 'replaces' itself with the real extension, loading it via imp
> from the platform specific build directory that distutils creates.

This looks clever.  However, how do you make sure the module doesn't
get itself installed?  I.e. I'd not want this hack make it into the
installed copy, while it is perfectly OK for quick in-place builds
and tests.

Paul


More information about the Distutils-SIG mailing list