[Distutils] Optional C extensions and setuptools

Christopher Armstrong radix at twistedmatrix.com
Mon Mar 19 01:08:50 CET 2007


On 3/18/07, Bob Ippolito <bob at redivi.com> wrote:
> I've just added a small optional C extension to simplejson to speed up
> decoding, but I have a feeling that it's going to cause problems for
> Windows users.
>
> Right now it's specified as setuptools Feature the same way that
> PyProtocols' speedups module is implemented.
>
> Is there something I can do in the setup.py to fail gracefully and
> install anyways if it can't compile the extension? In some way that's
> compatible with easy_install?

Twisted does this: it subclasses build_ext and overrides
build_extensions to check if there's a C compiler before upcalling.


-- 
Christopher Armstrong
International Man of Twistery
http://radix.twistedmatrix.com/
http://twistedmatrix.com/
http://canonical.com/


More information about the Distutils-SIG mailing list