[Distutils] Optional C extensions and setuptools

Andrew Straw strawman at astraw.com
Thu Mar 22 02:59:35 CET 2007


Bob Ippolito wrote:
> On 3/18/07, Christopher Armstrong <radix at twistedmatrix.com> wrote:
>   
>> 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.
>>
>>     
>
> I see. Took me a while to find it in that mess, but it looks like that
> might work if necessary.
>
> Anyone have something that does it a little more directly?
>
>   
See *class* ve_build_ext in 
http://visionegg.org/trac/browser/trunk/visionegg/setup.py


More information about the Distutils-SIG mailing list