PyQt6 and SIP v6 Snapshots Available

Eli Schwartz eschwartz at archlinux.org
Wed Sep 23 22:17:42 BST 2020


On 9/23/20 1:42 PM, Phil Thompson wrote:
> On 23/09/2020 18:33, Detlev Offenbach wrote:
>> Hi Phil,
>>
>> the download page says, that 'pyrcc' has been removed. What will be
>> the successor? The eric-ide sources use resource files and thus
>> depends on pyrcc.
> 
> I don't plan a successor as I don't see the point of resource files in a
> Python context.
> 
> What do you use it for?
> 
> Phil

+1

qresource files are intended to embed random data files into
single-executable style software distributions, to reduce the number of
moving parts. This is as opposed to doing proper installation management
unix style, and is of limited use on Windows too, as long as people ship
Qt itself as shared libraries necessitating a directory structure.

This is all fine and well for C++ programs where qresources get
statically linked into the executable itself, reducing the number of
files to be installed.

What's the point of it for generating *.py files with that data? You end
up with multiple files to distribute anyway.

pkg_resources.resource_filename() and its modern equivalent, the stdlib
importlib.resources, allows you to access real files through standard
pythonic mechanisms, without the wrapper abstractions and without an the
rcc compiler. There's no need to handle data blobs as python inline
strings, try to byte-compile something that doesn't really byte-compile
well, etc.

The resulting files are easily introspectable and modifiable in the
built software bundle (because they are the original files) and only get
read at the time of use.

Really -- what is the big attraction to using qresources in python?

-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1601 bytes
Desc: OpenPGP digital signature
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20200923/84183a1e/attachment-0001.sig>


More information about the PyQt mailing list