[PyQt] How to compile with PyQt5?

Kovid Goyal kovid at kovidgoyal.net
Fri Jul 25 11:58:25 BST 2014

On Fri, Jul 25, 2014 at 11:07:49AM +0100, Phil Thompson wrote:
> On 25/07/2014 10:28 am, Kovid Goyal wrote:
> >On Fri, Jul 25, 2014 at 09:47:26AM +0100, Phil Thompson wrote:
> >>On 25/07/2014 4:36 am, Kovid Goyal wrote:
> >>>1600 lines? That's crazy. Here's an extract from calibre's build system.
> >>
> >>To add some perspective to this, the amount of code you have to actually
> >>write for a more representative extension module than QScintilla (eg.
> >>QtDataVisualization) is 80 lines. For that you get a configure.py with a
> >>consistent user interface with other PyQt based extension modules,
> >>support
> >>for cross-compiling to iOS, Android etc etc.
> >
> >Then perhaps people asking about how to build on PyQt 5 should be pointed
> >to one of these more representative modules. I remember that when I was
> >doing the calibre transition to Qt 5 I also came across the advice to
> >look at QScintilla, and rather than trying to adapt that beast, I wrote
> >my own minimal build logic that does what calibre needs.
> QScintilla is the only open source code that uses it.

So maybe create a dummy extension that illustrates it.

> >Sounds fine to me. I was just trying to help the OP, since from
> >experience, trying to adapt QSintilla's build system is not a task to be
> >taken on lightly. Even just having some officially sanctioned method of
> >gathering information like runtime paths and compiler flags would be
> >helpful. Essentially, something like qmake -query
> I suspect that you looked at it before I did the refactor to the
> easy-to-use, fully-documented version.

Possible, it was several months ago. Looking at it now, it took me about
10 minutes to figure out that what I needed to do was copy the entire
file and then modify parts of the ModuleConfiguration class for my
module. And even then, I am still not sure how I'd go about
integrating it into a larger build system like calibre, as opposed to
just using it to build a standalone module. My approach would be to run
it as a standalone builder in a temp dir and copy its output files into
the calibre build tree. This is not optimal for obvious reasons.

Particularly for the use case of an existing build system for an
application that has internal PyQt extensions that are not intended
to be made available system-wide, a way to just get the needed runtime
paths/compiler flags would be a lot easier to use. That way, one can
just needs to run sip with the provided flags, then generate a .pro file 
and then run qmake && make

Personally, I dont care since I already have the code to get that
information, but it might be nice to make that code a part of PyQt so it
does not have to be duplicated everywhere. Anyway, I have rambled on
enough. I suspect you already know all this, since you are considering



Dr. Kovid Goyal 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140725/dd6dbee5/attachment.sig>

More information about the PyQt mailing list