View Single Post
Old 01-05-2022, 02:36 PM   #65
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,705
Karma: 205039118
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm trying to get a handle on what all of my options are, here. So a few questions:

1) If I want to use the handy-dandy-
Code:
from qt.core import yada
-built-in compatibility approach, then the minimum calibre version needed for my plugin will now become 5.13, right? Basing this on:
Quote:
Originally Posted by kovidgoyal View Post
Indeed, from calibre 5.13 onwards you can simply do all Qt related imports as

from qt.core import whatever

It works on qt 5 and qt 6. This is what is used in calibre source code itself.
2) My hope for my plugins was to drop support for PtQt4 completely and use my own try/except imports for PyQt5/6 in order to support calibre 2.0+. This seems fairly trivial in my testing and, in fact, seems to work just fine... on systems where calibre is using its own embedded Python/Qt/PyQt. However, this fails miserably on my Arch machine using the pacman-supplied calibre 5.33 because my system has both PyQt5 and PyQt6 installed at the same time. So the initial import of PyQt6 in my plugin does not fail like I need it to with Calibre 5.33 on that system. Any way around this? I don't want to have to tell my users that they need to uninstall PyQt6 on Arch to get things working.

No criticism/judgement, here. I'm just making sure I understand all my options before making a decision about what to do.

The easiest thing to do would be to forget everything that came before calibre 5.13. I just don't know if I'm ready to do that. I was hoping to support calibre 2.0+ on all systems. Even those with debundled python/qt that might have multiple PyQt versions installed like my Arch machine.

Last edited by DiapDealer; 01-05-2022 at 03:03 PM.
DiapDealer is offline   Reply With Quote