[PyQt] problems porting a project from sip4 to sip5

Steve Borho steve at borho.org
Fri Apr 17 19:42:23 BST 2020



> On Apr 17, 2020, at 3:51 AM, Phil Thompson <phil at riverbankcomputing.com> wrote:
> 
> On 16/04/2020 23:52, Steve Borho wrote:
>> Hello,
>> I maintain a couple of relates SIP projects that I am trying to port
>> to sip5 and binary wheel distributions.  To keep things simple, lets
>> say there is a C++ library for a widget foo, and Python wrappers that
>> we’ll call pyfoo.
>> I have written a pyproject.toml for pyfoo such that sip-wheel can
>> generate wheels which install a “foo” python package containing a
>> pyfoo.so shared library. This wheel is 100% functional.
>> Next I have a fooapp which uses PyQt5 and has its own C++ functions
>> which compile against Qt and the foo C++ library.  This gets compiled
>> into qtfoo.so and it’s SIP wrapper includes:
>> %Import QtGui/QtGuimod.sip
>> %Import QtWidgets/QtWidgetsmod.sip
>> %Import QtNetwork/QtNetworkmod.sip
>> %Import foomod.sip
>> I have written a pyproject.toml for fooapp that sip-build can compile
>> into a qtfoo.so and sip-wheel can create a wheel for it.  But no
>> matter how I try and load the qtfoo.so it always errors with the
>> message:
>>    from .qtfoo import get_qtfoo_version
>> RuntimeError: the foo.pyfoo module failed to register with the sip module
>> I get this error even though the previous line of Python code was able
>> to import pyfoo.so from the foo package.  There is a binary dependency
>> here that I can’t determine.
>> I read the documentation about standalone and package modules, and
>> followed the steps to make a foo-sip wheel that installs
>> foo/bindings/pyfoo/foomod.sip and the other sip files, but this did
>> not seem to help with the library interdependency.
>> I’m missing something basic, any hints on where to look?
> 
> https://www.riverbankcomputing.com/static/Docs/PyQt5/pyqt_builder.html
> 
> Phil

Thanks for the response.

On a (barely) related note, is there a clean way in project.py to set or override the version value from [tool.sip.metadata]?  I am currently wrapping the setup() function of Project and assigning self.version_str when it returns, this seem sub-optimal.

—
Steve Borho


More information about the PyQt mailing list