I tried to use PySide6 api (only) for QtPy with no luck. kajongg uses PyQt directly (for sip) so either way I ended up by installing PyQt6 too. Maybe version 24.*.* still ok with default PyQt5 but I guess for kajongg slot (6) it make sense to use PyQt6 api.
Current status: https://invent.kde.org/games/kajongg/-/blob/d1dd170ec09ece0e0fdc652b7e73aba6119c0cde/src/qt.py#L140-L152 > from PyQt6 import sip Will trigger error when PyQt api disabled > err: No module named 'PyQt6'
I think that was an unintended change by upstream during Qt6 porting.
Please check out the newly attached upstream patch to see if it fixes your problem when QtPy is installed without PyQt support.
$ kajongg qt.gui.icc: fromIccProfile: failed size sanity 2 C: * Kajongg is not correctly installed: modules: cannot import name 'sip_cast' from 'qt' (/usr/share/kajongg/qt.py) Traceback (most recent call last): File "/usr/share/kajongg/kdestub.py", line 115, in desktopSize result = Internal.app.desktop().availableGeometry() ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'KApplication' object has no attribute 'desktop' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/bin/kajongg", line 189, in <module> from mainwindow import MainWindow File "/usr/share/kajongg/mainwindow.py", line 88, in <module> logError("\n".join(f" * {s}" for s in NOTFOUND), showStack=False) File "/usr/share/kajongg/log.py", line 146, in logError return logMessage(msg, logging.ERROR, True, showStack=showStack, withGamePrefix=withGamePrefix) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/kajongg/log.py", line 135, in logMessage return Information(msg) if prio == logging.INFO else Sorry(msg, always=True) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/kajongg/dialogs.py", line 193, in __init__ dialog = Prompt(msg, icon=QMessageBox.Icon.Information, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/kajongg/dialogs.py", line 81, in __init__ KMessageBox.createKMessageBox( File "/usr/share/kajongg/kdestub.py", line 216, in createKMessageBox desktop = KApplication.desktopSize() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/kajongg/kdestub.py", line 117, in desktopSize assert Internal.mainWindow ^^^^^^^^^^^^^^^^^^^ AssertionError
BTW in case of PySide6 there should also be USE="designer" either for QtPy or Pyside6 and qttools IIRC Because of > err: No module named 'PySide6.QtUiTools'
Not sure if this correct but I added sip_cast to `else` block too --- else: def sip_cast(obj, _type): """hide not so nice things in qt.py""" return False HAVE_SIP = False --- It launched and About dialog shows PySide6 api in use.
This would be better placed in the upstream bug report ;)
I'm too lazy to register there right now. Please copy/paste if you think it worth to mention there.
(In reply to Bug Bugs from comment #5) > BTW in case of PySide6 there should also be USE="designer" either for QtPy > or Pyside6 and qttools IIRC > Because of > > err: No module named 'PySide6.QtUiTools' grep returns nothing for that, where was that coming from? Note that kajongg is also silent for me without this flag set on either pyside6 or PyQt6.
It was from my first attempt to use PySide6 only. I kept rebuilding it with modules kajongg asked. QtPy-2.4.1/qtpy/uic.py:76 > if PYSIDE6: > from PySide6.QtCore import QMetaObject > from PySide6.QtUiTools import QUiLoader, loadUiType > elif PYSIDE2: > from PySide2.QtCore import QMetaObject > from PySide2.QtUiTools import QUiLoader > ... Maybe it just want qttools installed. USE="designer" pulled this package for me.
FYI in new upstream commit they possibly missed QT5/6 -> PYQT5/6 changes. Not tried those patches yet. https://invent.kde.org/games/kajongg/-/commit/3f12d305cc56814b72c561b36271494a21cf236d
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/kde.git/commit/?id=d9c29bc3d505f042f6e6d60bed83d82824b56a26 commit d9c29bc3d505f042f6e6d60bed83d82824b56a26 Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2024-09-10 20:05:39 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2024-09-11 06:34:31 +0000 kde-apps/kajongg: Add dev-python/QtPy[ || ( pyside6 pykde6 ) ] USEdep Bug: https://bugs.gentoo.org/939423 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> kde-apps/kajongg/kajongg-24.08.1.ebuild | 1 + kde-apps/kajongg/kajongg-24.08.49.9999.ebuild | 1 + kde-apps/kajongg/kajongg-9999.ebuild | 1 + 3 files changed, 3 insertions(+)
With only patch from the upstream commit (as expected) --- $ kajongg Traceback (most recent call last): File "/usr/bin/kajongg", line 19, in <module> from qt import QObject, QCommandLineParser, QCommandLineOption, Qt, QGuiApplication File "/usr/share/kajongg/qt.py", line 147, in <module> from PyQt6 import sip # type:ignore[no-redef] ^^^^^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'PyQt6' --- Obviously we need both patches (proposed fix and that commit). As was said >> The kajongg source code he points to sets HAVE_SIP to False if neither PyQt6 >> nor PyQt5 is found. > No, it sets it to false if both QT5 and QT6 are false (which should > never happen). You probably want 'if PYQT5' and 'elif PYQT6' instead.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=67e77a54889d54c697923dd9c9b59ebdf227a258 commit 67e77a54889d54c697923dd9c9b59ebdf227a258 Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2024-09-12 15:50:34 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2024-09-12 19:27:08 +0000 kde-apps/kdegames-meta: 24.08.1 version bump, dropping ~riscv,~x86 Bug: https://bugs.gentoo.org/939423 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> .../kdegames-meta/kdegames-meta-24.08.1.ebuild | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f48d0da29910aef82158d2ae63a3e08a9a17605f commit f48d0da29910aef82158d2ae63a3e08a9a17605f Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2024-09-12 15:50:00 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2024-09-12 19:27:06 +0000 kde-apps/kajongg: 24.08.1 version bump, dropping ~riscv,~x86 Bug: https://bugs.gentoo.org/939423 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> kde-apps/kajongg/Manifest | 1 + kde-apps/kajongg/kajongg-24.08.1.ebuild | 47 +++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+)
This appears to be finally fixed in git master.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8749fab502c985af1c3dde0b573de4d5bad45770 commit 8749fab502c985af1c3dde0b573de4d5bad45770 Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2024-09-14 13:41:37 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2024-09-14 13:43:23 +0000 kde-apps/kajongg: Fix runtime w/ dev-python/QtPy[pyside6] (w/o PyQt6) Closes: https://bugs.gentoo.org/939423 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> .../files/kajongg-24.08.1-fix-w-o-pyqt6.patch | 156 +++++++++++++++++++++ kde-apps/kajongg/kajongg-24.08.1-r1.ebuild | 49 +++++++ 2 files changed, 205 insertions(+)
Finally, also picked for 24.08 branch.
(In reply to Larry the Git Cow from comment #12) > kde-apps/kajongg: Add dev-python/QtPy[ || ( pyside6 pykde6 ) ] USEdep Apologies if off-topic, but to my knowledge, there is no PyKDE6; newest, PyKDE5.
I'm not sure how that happened, but what's important here is code: > || ( dev-python/QtPy[pyqt6] dev-python/QtPy[pyside6] ) Which is correct.