Il giorno dom, 15/11/2009 alle 11.39 +0000, Phil Thompson ha scritto: > On Fri, 13 Nov 2009 20:53:34 +0100, Giovanni Bajo <[email protected]> > wrote: > > Hi Phil, > > > > please find attached an improved sipdistutils.py, and the diff against > > current version for reference. > > > > Modifications: > > > > * Added command line option to pass arguments to sip. Now you can for > > instance do: "python setup.py build --sip-opts='-e'" to activate > > exceptions. Or you can put the "sip-opts='-e'" in a local distutils.cfg > > file in your source directory. > > > > * Fixed invocation of sip.exe under Windows. I still maintain that > > siputils.py should put the full pathname of sip, including extension, > > under the "sip_bin" in the configuration, but a quick workaround is > > needed anyway to make sipdistutils work with all versions of sip. > > I consider the extension an implementation detail that shouldn't be > exposed.
I need the full pathname to compute the checksum. How do I suggest I find it out then? Should I iterate over supported extensions until I find the correct one? > It won't be .exe for SIP v5. Out of curiosity, what will it be? > > * Consider the sip binary checksum as an implicit dependency for build. > > This is very useful when switching between different sip versions, > > because everything is automatically recompiled. > > > > Coming up: > > > > * As discussed some months ago, I plan to add an option to sip itself > > to printf() any .sip file it opens. I will then use a dry-run with this > > option to automatically discover dependencies so to rebuild whenever > > necessary. This would be a strong improvement over the current state > > where one must manually list all sip files (theoretically, of all > > imported modules as well) in the setup.py. > > Applied to the trunk. > > Feel free to send a patch for the documentation :) Attached. I assumed most distutils users are not familiar with passing options to distutils' subcommands, so I elaborated on it a little. -- Giovanni Bajo Develer S.r.l. http://www.develer.com
Index: distutils.rst =================================================================== --- distutils.rst (revisione 26185) +++ distutils.rst (copia locale) @@ -23,3 +23,19 @@ As we can see, the above is a normal distutils setup script, with just a special line which is needed so that SIP can see and process ``word.sip``. Then, running ``setup.py build`` will build our extension module. + +If you want to use any of sip's command-line options described in +:ref:`ref-command-line`, there is a new option available for the +``build_ext`` command in distutils: ``--sip-opts``. So you can either invoke +distutils as follows:: + + $ python setup.py build_ext --sip-opts="-e -g" build + +or you can leverage distutils' config file support by creating a ``setup.cfg`` +file in the supported system or local paths (eg: in the same directory of +``setup.py``) with these contents:: + + [build_ext] + sip-opts = -e -g + +and then run ``setup.py build`` as usual. Index: command_line.rst =================================================================== --- command_line.rst (revisione 26185) +++ command_line.rst (copia locale) @@ -1,3 +1,5 @@ +.. _ref-command-line: + The SIP Command Line ====================
_______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
