[PyQt] sipdistutils.py - adding custom options to the sip build command

Giovanni Bajo rasky at develer.com
Wed Jul 1 13:50:54 BST 2009


On 5/1/2009 10:10 AM, Phil Thompson wrote:
> On Fri, 24 Apr 2009 20:28:14 +0200, Stefano Brilli <cyber at develer.com>
> wrote:
>> Hi,
>>
>> While using sipdistutils.py I noticed that it is not possible to add the
>> "-e" flag to the sip build command. So I did a little change in
>> sipdistutils.py
>>
>> I would like to contribute with this patch.
>>
>> (And this is a small using example)
>>
>> --------------------- setup.py -----------------------
>> from distutils.core import setup
>> from distutils.extension import Extension
>> import sipdistutils
>> import os
>> import sys
>>
>> sipdistutils.additional_sip_options.append('-e')
> 
> I'm not a distutils expert - is adding a module-level list the right way to
> extend the functionality? Seems a bit hackish to me.
> 
> Giovanni?

Distutils is a pile of hacks, if you ask me... I don't see any other way 
to expose the functionality.

You're supposed to register a class object into distutils, and it takes 
care of instatiating it. Stefano could put the list at class scope 
instead of module scope, but it doesn't change much if you ask me. 
There's not even existing code to look at: the most similar thing is the 
SWIG support, and it doesn't provide a way of customizing the swig 
invokation.
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com


More information about the PyQt mailing list