[PyQt] How to build pyqt sources to provide the same content than official wheel?
Phil Thompson
phil at riverbankcomputing.com
Sat Jul 20 12:45:03 BST 2019
On 20/07/2019 11:58, Scener Spanish wrote:
> Hello everyone (specially Phil :))
>
> I've recently subscribed to the pyqt mailing list so it seems I can't
> reply
> to existing threads when using gmail. I'm the user from #pyqt who was
> having issues when building pyqt from sources who's mentioned here
> https://www.riverbankcomputing.com/pipermail/pyqt/2019-July/041953.html
>
> Anyway, I'm really interested to get a qt bug fix who's already living
> in
> upstream https://bugreports.qt.io/browse/QTBUG-74492 , as you can see
> that
> fix is living in both 5.12.5, 5.13.1 and dev branches.
>
> The current pypi wheel https://pypi.org/project/PyQt5/5.13.0/ at this
> moment still contains that annoying bug so I've tried to build
> https://www.riverbankcomputing.com/static/Downloads/PyQt5/PyQt5_gpl-5.13.1.dev1907191722.zip
> but
> the result has been not good. Here'a the steps I've followed:
>
> 1) I've built https://github.com/qt/qtbase 5.13.0-394-g69ef6e8212 (you
> can
> check the commit hash by doing git rev-parse). Why did I choose this
> one?
> Mainly because this specific commit had the bug fix I was really
> interested
> with and also because the MODULE_VERSION = 5.13.1.
>
> 2) To build it I've had to add openssl support otherwise pyqt would
> crash
> when building (for more info you can check the other Florian's thread
> where
> he also proposes a pyqt fix in one of the sip files), here's the
> configuration I've used:
>
> configure.bat -prefix "d:/qt/5.13.0-394-g69ef6e8212" -opensource
> -confirm-license -nomake examples -nomake tests -opengl dynamic -ssl -L
> D:/software/vcpkg/installed/x86-windows/lib -I
> D:/software/vcpkg/installed/x86-windows/include -v
>
>
> 3) Then, I've just run this little batch file:
>
> %echo off
> setlocal
> set SIP_PATH=D:\virtual_envs\packages_sources\3rdparty\sip-4.19.18
> set QMAKE_PATH=D:\qt\5.13.0-394-g69ef6e8212\bin
> rem set QMAKE_PATH=D:\qt\5.13.0-941-g56fb2266f2\bin
> set PYQT_PATH=PyQt5_gpl-5.13.1.dev1907171931
> set PATH=%QMAKE_PATH%;%SIP_PATH%\sipgen;%PATH%
> where qmake
> if ERRORLEVEL 1 (
> echo qmake.exe not found in %QMAKE_PATH%
> exit /b
> )
> where sip
> if ERRORLEVEL 1 (
> echo sip.exe not found in %SIP_PATH%
> exit /b
> )
> pushd %PYQT_PATH%
> python configure.py --sip-incdir=%SIP_PATH%\siplib --confirm-license
> nmake
> popd
>
>
> 4) Finally, I've just installed all the generated content doing `nmake
> install`
>
> Anyway, the result has been really bad and the experience quite
> frustrating... I've ended up with an installation that doesn't look at
> all
> like the nice installation from the official pypi wheels, a lot of
> missing
> content and also a lot of additional sip files copied to the
> virtualenv...
> the installation at this this point is basically unusable :'(
I don't see why it should be unusable. It will be the full installation
(a wheel is a subset), use your existing Qt installation and can still
be uninstalled with pip.
> So my questions are:
>
> - What'd be the right procedure to get a nice wheel that looks like the
> official pypi ones?
At the moment you can't do this because it relies on internal tools.
> - I've been told eventually you'll be providing a proper setup.py in
> the
> source packages that will allow to build nice wheels instead this
> non-standard bizarre way to build pyqt, is that true? That'd be
> extremely
> awesome!
Yes, see below.
> - Is there any release date where a new pyqt wheel will be landing at
> pypi
> that contains the bug fix of
> https://bugreports.qt.io/browse/QTBUG-74492 ?
That depends on when the fixed version of Qt is released.
sip5 implements a new build system that supports PEP517. This is
finished (apart from the docs) and is just being tweaked to support
PyQt5's new build system (which is currently being written). This might
sound a lot of work but is mostly a refactoring of those internal tools
I mentioned earlier that I've been using for years.
PyQt5's new build system will also include a tool that will allow you to
update a wheel with a new version of Qt.
ETA for sip5 is between 1 and 2 months.
Phil
More information about the PyQt
mailing list