[PyQt] How to compile with PyQt5?

Jacob Floyd cognifloyd at gmail.com
Fri Jul 25 02:07:02 BST 2014

Hello everybody,

I'm trying to get sip bindings[1] for FakeVim[2] (Vim emulation in
QTextEdit, QPlainTextEdit and similar Qt widgets), so of course it will be
built on PyQt. However, I'm having a hard time getting a build system to
reliably build those sip bindings on both PyQt4 and PyQt5.

With PyQt4, pyqtconfig made for a fairly simple configure.py, but I need it
to work with both PyQt4 and PyQt5, so pyqtconfig is no longer an option.

The docs[3][4] list QScintilla as a good example of something that builds
on PyQt.
Plus, according to Phil[5], I should just copy/paste/modify QScintilla's
So, I copy/paste QScintilla's Python/configure*.py and then ran it through
sed[6][7] to remove all of the QScintilla stuff.

When I showed what I did to hluk, the maintainer of FakeVim, he said[8]:
> The new configure.py file has over 1600 lines. This starts to be overly
> There must be simpler way to do this, otherwise it would be hell to

So, after searching docs, the ml, and the web in general, I'm looking for
advice here: Isn't there a simpler way? A simple build system for modules
that support extending both PyQt4 & PyQt5? There's only one sip file right
now, so it seems like 1600 lines is quite a bit of overhead to compile so
few sip bindings.

At least in its current state (run build.sh in the qscintilla folder[9]) my
test can't import FakeVim, so I'm left wondering where the build system, or
maybe the test script, needs to be tweaked.

What should I do next in my quest for FakeVim sip bindings for both PyQt 4
and PyQt 5? Is there a simpler build system than the one provided in

Jacob Floyd

[1] https://github.com/hluk/FakeVim/issues/5
[2] https://github.com/hluk/FakeVim
[3] http://pyqt.sourceforge.net/Docs/PyQt4/build_system.html
[4] http://pyqt.sourceforge.net/Docs/PyQt5/extension_api.html
[5] http://article.gmane.org/gmane.comp.python.pyqt-pykde/27125
[6] https://github.com/hluk/FakeVim/issues/5#issuecomment-50088032
Aside: One of the issues that this sed script takes care of is changing
qscintilla's hardcoded sip files that are hardcoded outside of the
"editable" section.
There is an assumption that sip files will always be in sip/ which should
be editable.
[8] https://github.com/hluk/FakeVim/issues/5#issuecomment-50054483
[9] https://github.com/cognifloyd/FakeVim/tree/python/qscintilla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140724/07a5d257/attachment.html>

More information about the PyQt mailing list