[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: how to get SIP ABI version PyQt is built with?
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2021-05-13 14:04:14
Message-ID: 0d159dbe096e544445446f4373879449 () riverbankcomputing ! com
[Download RAW message or body]

On 13/05/2021 04:22, Kovid Goyal wrote:
> Some Linux distros, for instance, Arch Linux, have PyQt packages built
> with a version of SIP different from the version of SIP they ship. This
> is a distro bug, but given it is so easy to do, its likely to crop up 
> in
> the future as well.

I don't see that as a bug. What matters is the version of the sip module 
ABI that a project requires. The version of SIP shouldn't matter so long 
as it supports that ABI version.

> When building third party extension modules for PyQt on such a distro,
> the resulting modules are not importable since the SIP ABI version
> mismatches. I currently workaround this in the calibre build system
> by getting the sip-abi-version PyQt was built against and adding that 
> to
> pyproject.toml (which is dynamically generated by the calibre build
> system). See this commit:
> https://github.com/kovidgoyal/calibre/commit/73a312dd648143006184ed71a0aab7336dc03cc1

Why don't you just specify the minimum version of the sip ABI that you 
need?

With hindsight I should have called the 'abi-version' project option 
'minimum-abi-version'.

> However the code to get the sip-abi-version is pretty fragile. It tries
> to find the QtCore.toml file on the filesystem and get it from there.
> It would be nice if there was some more well defined/robust way to do
> this, either by having it as a constant like PYQT_VERSION_STR on 
> QtCore,
> or some other mechanism. Maybe there is already such a mechanism, but I
> cant find it.
> 
> For instance have the this information in a txt or toml file in
> the PyQt5 root directory, then it can be queried using
> importlib.resources.get_text.
> 
> Failing that is there at least some "official" way to query the path
> to the bindings directory?

I'm happy to add something, but I'm not sure it's necessary for this 
case.

Phil
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic