Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-AnyQt for openSUSE:Factory checked in at 2022-09-16 13:32:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-AnyQt (Old) and /work/SRC/openSUSE:Factory/.python-AnyQt.new.2083 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-AnyQt" Fri Sep 16 13:32:20 2022 rev:10 rq:1003974 version:0.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-AnyQt/python-AnyQt.changes 2022-08-02 22:10:29.065996048 +0200 +++ /work/SRC/openSUSE:Factory/.python-AnyQt.new.2083/python-AnyQt.changes 2022-09-16 13:32:44.185345389 +0200 @@ -1,0 +2,20 @@ +Thu Sep 15 21:51:05 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com> + +- update to 0.2.0 + * Bump version: 0.2.0rc1 ??? 0.2.0 + * Bump version: 0.1.1 ??? 0.2.0rc1 + * CI: Add libxcb-shape0 to list of linux system packages + * CI: Add PySide2 to CI tests + * PySide2: Fix for PYSIDE-237 bug + * PySide2: Add compatible QPdfWriter.setPageSize overload + * test_qaction_set_menu: PySide2 compatibility + * QtCore: Expose cast/wrap/unwrapinstance, ... + * QtCore: Add BoundSignal type + * PySide2: alias missing exec methods + * PySide2: Add missing QActionEvent.{action,before} + * PySide2: Import missing pieces + * pyside2: drawPixmapFragments compatibility + * pyside2: QtTest compatibility + * pyside2: QSettings compatibility + +------------------------------------------------------------------- Old: ---- AnyQt-0.1.1.tar.gz New: ---- AnyQt-0.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-AnyQt.spec ++++++ --- /var/tmp/diff_new_pack.t4an9V/_old 2022-09-16 13:32:44.641346862 +0200 +++ /var/tmp/diff_new_pack.t4an9V/_new 2022-09-16 13:32:44.645346875 +0200 @@ -19,7 +19,7 @@ %define skip_python2 1 %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-AnyQt -Version: 0.1.1 +Version: 0.2.0 Release: 0 Summary: PyQt4/PyQt5 compatibility layer License: GPL-3.0-only ++++++ AnyQt-0.1.1.tar.gz -> AnyQt-0.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyQt-0.1.1/AnyQt/QtCore.py new/AnyQt-0.2.0/AnyQt/QtCore.py --- old/AnyQt-0.1.1/AnyQt/QtCore.py 2022-06-13 12:12:31.000000000 +0200 +++ new/AnyQt-0.2.0/AnyQt/QtCore.py 2022-08-02 13:07:00.000000000 +0200 @@ -248,6 +248,7 @@ Signal = pyqtSignal Slot = pyqtSlot Property = pyqtProperty + BoundSignal = pyqtBoundSignal Qt.Alignment = Qt.AlignmentFlag Qt.ApplicationStates = Qt.ApplicationState Qt.DockWidgetAreas = Qt.DockWidgetArea @@ -281,6 +282,7 @@ Signal = pyqtSignal Slot = pyqtSlot Property = pyqtProperty + BoundSignal = pyqtBoundSignal elif _api.USED_API == _api.QT_API_PYQT4: from PyQt4 import QtCore as _QtCore, QtGui as _QtGui @@ -337,6 +339,7 @@ _major, _minor, _micro = tuple(map(int, qVersion().split(".")[:3])) QT_VERSION = (_major << 16) + (_minor << 8) + _micro QT_VERSION_STR = "{}.{}.{}".format(_major, _minor, _micro) + BoundSignal = Signal # Missing in PyQt4 <= 4.11.3 if not hasattr(QEvent, "MacSizeChange"): @@ -384,6 +387,71 @@ if not hasattr(QLibraryInfo, "location"): QLibraryInfo.location = QLibraryInfo.path + +if _api.USED_API == _api.QT_API_PYSIDE2: + class QSettings(QSettings): + """ + A subclass of QSettings with a simulated `type` parameter in + value method. + + """ + # QSettings.value does not have `type` type in PySide2 + def value(self, key, defaultValue=None, type=None): + """ + Returns the value for setting key. If the setting doesn't exist, + returns defaultValue. + """ + if not self.contains(key): + return defaultValue + + value = super().value(key) + if type is not None: + value = self.__qvariant_cast(value, type) + if value is None: + value = defaultValue + return value + + from AnyQt._compat import qvariant_cast as __qvariant_cast + __qvariant_cast = staticmethod(__qvariant_cast) + try: + QStringListModel + except NameError: + from PySide2.QtGui import QStringListModel + + +pyqtSignal = Signal +pyqtSlot = Slot +pyqtProperty = Property + +if _api.USED_API == _api.QT_API_PYSIDE2: + try: + from PySide2 import shiboken2 as __shiboken2 + except ImportError: + import shiboken2 as __shiboken2 + + def cast(obj, type_): + addr = unwrapinstance(obj) + return wrapinstance(addr, type_) + + def unwrapinstance(obj): + addr, = __shiboken2.getCppPointer(obj) + return addr + + wrapinstance = __shiboken2.wrapInstance + + def isdeleted(obj): + return not __shiboken2.isValid(obj) + + ispyowned = __shiboken2.ownedByPython + delete = __shiboken2.delete + ispycreated = __shiboken2.createdByPython +elif _api.USED_API in (_api.QT_API_PYQT5, _api.QT_API_PYQT6): + from AnyQt.sip import ( + cast, isdeleted, ispyowned, ispycreated, delete, unwrapinstance, + wrapinstance + ) + + #: Qt version as a (major, minor, micro) tuple QT_VERSION_INFO = tuple(map(int, qVersion().split(".")[:3])) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyQt-0.1.1/AnyQt/QtGui.py new/AnyQt-0.2.0/AnyQt/QtGui.py --- old/AnyQt-0.1.1/AnyQt/QtGui.py 2022-06-13 12:12:31.000000000 +0200 +++ new/AnyQt-0.2.0/AnyQt/QtGui.py 2022-08-02 13:07:00.000000000 +0200 @@ -266,6 +266,8 @@ # QGlyphRun, QRawFont, QStaticText, QTextDocumentWriter elif _api.USED_API == _api.QT_API_PYSIDE2: from PySide2.QtGui import * + from PySide2.QtWidgets import QUndoCommand, QUndoStack, QUndoGroup + from PySide2.QtWidgets import QShortcut, QAction, QActionGroup if _api.USED_API in [_api.QT_API_PYQT4, _api.QT_API_PYSIDE]: from AnyQt import QtCore as __QtCore @@ -294,9 +296,52 @@ QWheelEvent.angleDelta = __QWheelEvent_angleDelta QWheelEvent.pixelDelta = __QWheelEvent_pixelDelta +if _api.USED_API == _api.QT_API_PYSIDE2: + from PySide2.QtCore import QRectF as __QRectF + _QPainter_drawPixmapFragments_orig = QPainter.drawPixmapFragments + class __ArgsTypeError(TypeError): pass + + def _QPainter_drawPixmapFragments(painter, fragments, *args, **kwargs): + def f1(fragment, size, pixmap=None, hints=QPainter.PixmapFragmentHints()): + # dispatch to original if possible + if isinstance(size, int) and isinstance(pixmap, QPixmap): + _QPainter_drawPixmapFragments_orig(painter, fragment, size, pixmap, hints) + else: + raise __ArgsTypeError + try: + f1(fragments, *args, **kwargs) + return + except __ArgsTypeError: + pass + + def f2(fragments, pixmap, hints=QPainter.PixmapFragmentHints()): + if isinstance(pixmap, QPixmap): + return (fragments, pixmap) + else: + raise TypeError + fragments, pixmap = f2(fragments, *args, **kwargs) + # emulate the api + painter.save() + oldtr = painter.worldTransform() + oldopacity = painter.opacity() + for frag in fragments: # type: QPainter.PixmapFragment + tr = QTransform(oldtr) + x, y = frag.x, frag.y + tr.translate(x, y) + tr.rotate(frag.rotation) + painter.setTransform(tr) + painter.setOpacity(oldopacity * frag.opacity) + w = frag.scaleX * frag.width + h = frag.scaleY * frag.height + sourceRect = __QRectF( + frag.sourceLeft, frag.sourceTop, frag.width, frag.height) + painter.drawPixmap( + __QRectF(-0.5 * w, -0.5 * h, w, h), pixmap, sourceRect) + painter.restore() + QPainter.drawPixmapFragments = _QPainter_drawPixmapFragments -if _api.USED_API == _api.QT_API_PYQT5: - # PyQt5 does not support setPageSize(QPageSize) overload +if _api.USED_API in (_api.QT_API_PYQT5, _api.QT_API_PYSIDE2): + # PyQt5, PySide2 do not support setPageSize(QPageSize) overload def QPdfWriter_setPageSize(self, size): if isinstance(size, QPageSize): self.setPageSizeMM(size.size(QPageSize.Millimeter)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyQt-0.1.1/AnyQt/QtTest.py new/AnyQt-0.2.0/AnyQt/QtTest.py --- old/AnyQt-0.1.1/AnyQt/QtTest.py 2022-06-13 12:12:31.000000000 +0200 +++ new/AnyQt-0.2.0/AnyQt/QtTest.py 2022-08-02 13:07:00.000000000 +0200 @@ -11,6 +11,16 @@ elif _api.USED_API == _api.QT_API_PYSIDE2: from PySide2.QtTest import * + +def _QTest_qSleep(ms: int): + import time + time.sleep(ms / 1000) + + +if not hasattr(QTest, "qSleep"): + QTest.qSleep = _QTest_qSleep + + def _QTest_qWaitForWindowExposed(widget, timeout=1000): # A Qt5 compatible (probably) QTest.qWaitForWindowExposed(QWidget, int) # (mostly copied from qtestsystem.h in qt5/qtbase) @@ -37,6 +47,10 @@ return window.testAttribute(Qt.WA_Mapped) +if not hasattr(QTest, "qWaitForWindowExposed"): + QTest.qWaitForWindowExposed = _QTest_qWaitForWindowExposed + + def _QTest_qWaitForWindowActive(widget, timeout=1000): # A Qt5 compatible (probably) QTest.qWaitForWindowActive(QWidget, int) # (mostly copied from qtestsystem.h in qt5/qtbase) @@ -66,10 +80,11 @@ return window.isActiveWindow() -if _api.USED_API in {_api.QT_API_PYQT4, _api.QT_API_PYSIDE}: - QTest.qWaitForWindowExposed = _QTest_qWaitForWindowExposed +if not hasattr(QTest, "qWaitForWindowActive"): QTest.qWaitForWindowActive = _QTest_qWaitForWindowActive + +if _api.USED_API in {_api.QT_API_PYQT4, _api.QT_API_PYSIDE, _api.QT_API_PYSIDE2}: from AnyQt.QtCore import QObject, QByteArray as _QByteArray # not exposed in PyQt4 or PySide. Going by PyQt5 interface @@ -134,16 +149,17 @@ from AnyQt.QtCore import Qt, QCoreApplication, QEvent, QEventLoop, QDeadlineTimer if predicate(): return True - remaining = timeout - deadline = QDeadlineTimer(remaining, Qt.PreciseTimer) + deadline = QDeadlineTimer(Qt.PreciseTimer) + deadline.setRemainingTime(timeout) while True: QCoreApplication.processEvents(QEventLoop.AllEvents) QCoreApplication.sendPostedEvents(None, QEvent.DeferredDelete) + if predicate(): + return True remaining = deadline.remainingTime() + if remaining > 0: QTest.qSleep(min(10, remaining)) - if predicate(): - return True remaining = deadline.remainingTime() if remaining <= 0: break @@ -153,4 +169,25 @@ if not hasattr(QTest, "qWaitFor"): # Qt < 5.10 QTest.qWaitFor = _QTest_qWaitFor + +def _QTest_qWait(timeout): + from AnyQt.QtCore import Qt, QCoreApplication, QEvent, QEventLoop, QDeadlineTimer + remaining = timeout + deadline = QDeadlineTimer(remaining, Qt.PreciseTimer) + while True: + QCoreApplication.processEvents(QEventLoop.AllEvents, remaining) + QCoreApplication.sendPostedEvents(None, QEvent.DeferredDelete) + remaining = deadline.remainingTime() + if remaining <= 0: + break + QTest.qSleep(min(10, remaining)) + remaining = deadline.remainingTime() + if remaining <= 0: + break + + +if not hasattr(QTest, "qWait"): # PySide2 + QTest.qWait = _QTest_qWait + + _api.apply_global_fixes(globals()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyQt-0.1.1/AnyQt/_compat.py new/AnyQt-0.2.0/AnyQt/_compat.py --- old/AnyQt-0.1.1/AnyQt/_compat.py 1970-01-01 01:00:00.000000000 +0100 +++ new/AnyQt-0.2.0/AnyQt/_compat.py 2022-07-18 15:55:11.000000000 +0200 @@ -0,0 +1,30 @@ +from typing import Union +from functools import lru_cache + +from AnyQt.QtCore import QObject, Property + + +@lru_cache(maxsize=200) +def _converter(type_: Union[type, str]): + class Obj(QObject): + _f = None + def _set(self, val): + self._f = val + def _get(self): + return self._f + + prop = Property(type_, _get, _set) + + def convert(value): + inst = Obj() + ok = inst.setProperty('prop', value) + if ok: + return inst.property('prop') + else: + return None + return convert + + +def qvariant_cast(value, type_: Union[type, str]): + converter = _converter(type_) + return converter(value) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyQt-0.1.1/AnyQt/_fixes.py new/AnyQt-0.2.0/AnyQt/_fixes.py --- old/AnyQt-0.1.1/AnyQt/_fixes.py 2022-06-13 12:12:31.000000000 +0200 +++ new/AnyQt-0.2.0/AnyQt/_fixes.py 2022-08-02 13:07:00.000000000 +0200 @@ -171,14 +171,123 @@ setattr(type_, name, value) +def fix_pyside_QActionEvent_action(namespace): + if namespace.get("__name__") != "AnyQt.QtGui": + return + import ctypes + try: + from PySide2 import shiboken2 # PySide2 < 5.12.0 + except ImportError: + import shiboken2 + from AnyQt.QtGui import QActionEvent + from AnyQt.QtWidgets import QAction + + class _QActionEvent(ctypes.Structure): + _fields_ = [ + ("vtable", ctypes.c_void_p), + # QEvent + ("d", ctypes.c_void_p), # private data ptr + ("t", ctypes.c_ushort), # type + ("_flags", ctypes.c_ushort), # various flags + # QActionEvent + ("act", ctypes.c_void_p), # QAction *act + ("bef", ctypes.c_void_p), # QAction *bef + ] + + def action(self): + return from_address(self.act, QAction) + + def before(self): + return from_address(self.bef, QAction) + + @classmethod + def from_event(cls, event: QActionEvent): + p, = shiboken2.getCppPointer(event) + return cls.from_address(p) + + def from_address(address: int, type_): + if address: + return shiboken2.wrapInstance(address, type_) + else: + return None + + def action(self): + ev = _QActionEvent.from_event(self) + return ev.action() + + def before(self): + ev = _QActionEvent.from_event(self) + return ev.before() + + if not hasattr(QActionEvent, "action"): + QActionEvent.action = action + if not hasattr(QActionEvent, "before"): + QActionEvent.before = before + + +def fix_pyside_exec(namespace): + if namespace.get("__name__") == "AnyQt.QtWidgets": + from PySide2.QtWidgets import QApplication, QDialog, QMenu + if "exec" not in QApplication.__dict__: + QApplication.exec = lambda self: QApplication.exec_() + if not hasattr(QDialog, "exec"): + QDialog.exec = lambda self: QDialog.exec_(self) + if not hasattr(QMenu, "exec"): + QMenu.exec = lambda self: QMenu.exec_(self) + if namespace.get("__name__") == "AnyQt.QtGui": + from PySide2.QtGui import QGuiApplication, QDrag + if "exec" not in QGuiApplication.__dict__: + QGuiApplication.exec = lambda self: QGuiApplication.exec_() + if not hasattr(QDrag, "exec"): + QDrag.exec = ( + lambda self, *args, **kwargs: QDrag.exec_(self, *args, **kwargs) + ) + elif namespace.get("__name__") == "AnyQt.QtCore": + from PySide2.QtCore import QCoreApplication, QEventLoop, QThread + if not hasattr(QCoreApplication, "exec"): + QCoreApplication.exec = lambda self: QCoreApplication.exec_() + if not hasattr(QEventLoop, "exec"): + QEventLoop.exec = ( + lambda self, *args, **kwargs: + QEventLoop.exec_(self, *args, **kwargs) + ) + if not hasattr(QThread, "exec"): + QThread.exec = lambda self: QThread.exec_(self) + elif namespace.get("__name__") == "AnyQt.QtPrintSupport": + from PySide2.QtPrintSupport import QPageSetupDialog, QPrintDialog + if "exec" not in QPageSetupDialog.__dict__: + QPageSetupDialog.exec = lambda self: QPageSetupDialog.exec_(self) + if "exec" not in QPrintDialog.__dict__: + QPrintDialog.exec = lambda self: QPrintDialog.exec_(self) + + +def fix_qstandarditem_insert_row(namespace): + if namespace.get("__name__") == "AnyQt.QtGui": + QStandardItem = namespace["QStandardItem"] + __QStandardItem_insertRow = QStandardItem.insertRow + + def QStandardItem_insertRow(self, row, items): + if isinstance(items, QStandardItem): + # PYSIDE-237 + __QStandardItem_insertRow(self, row, [items]) + else: + __QStandardItem_insertRow(self, row, items) + QStandardItem.insertRow = QStandardItem_insertRow + + GLOBAL_FIXES = { "pyqt6": [ fix_pyqt6_unscoped_enum, fix_pyqt6_qtgui_qaction_menu, ], "pyqt5": [ - fix_pyqt5_missing_enum_members - ] + fix_pyqt5_missing_enum_members, + ], + "pyside2": [ + fix_pyside_QActionEvent_action, + fix_pyside_exec, + fix_qstandarditem_insert_row, + ], } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyQt-0.1.1/AnyQt.egg-info/PKG-INFO new/AnyQt-0.2.0/AnyQt.egg-info/PKG-INFO --- old/AnyQt-0.1.1/AnyQt.egg-info/PKG-INFO 2022-06-13 13:00:26.000000000 +0200 +++ new/AnyQt-0.2.0/AnyQt.egg-info/PKG-INFO 2022-08-02 13:11:24.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: AnyQt -Version: 0.1.1 +Version: 0.2.0 Summary: PyQt5/PyQt6 compatibility layer. Home-page: https://github.com/ales-erjavec/anyqt Author: Ale?? Erjavec diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyQt-0.1.1/AnyQt.egg-info/SOURCES.txt new/AnyQt-0.2.0/AnyQt.egg-info/SOURCES.txt --- old/AnyQt-0.1.1/AnyQt.egg-info/SOURCES.txt 2022-06-13 13:00:26.000000000 +0200 +++ new/AnyQt-0.2.0/AnyQt.egg-info/SOURCES.txt 2022-08-02 13:11:24.000000000 +0200 @@ -33,6 +33,7 @@ AnyQt/QtXmlPatterns.py AnyQt/__init__.py AnyQt/_api.py +AnyQt/_compat.py AnyQt/_ctypes.py AnyQt/_fixes.py AnyQt/importhooks.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyQt-0.1.1/PKG-INFO new/AnyQt-0.2.0/PKG-INFO --- old/AnyQt-0.1.1/PKG-INFO 2022-06-13 13:00:26.754608200 +0200 +++ new/AnyQt-0.2.0/PKG-INFO 2022-08-02 13:11:24.767585800 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: AnyQt -Version: 0.1.1 +Version: 0.2.0 Summary: PyQt5/PyQt6 compatibility layer. Home-page: https://github.com/ales-erjavec/anyqt Author: Ale?? Erjavec diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyQt-0.1.1/setup.cfg new/AnyQt-0.2.0/setup.cfg --- old/AnyQt-0.1.1/setup.cfg 2022-06-13 13:00:26.754608200 +0200 +++ new/AnyQt-0.2.0/setup.cfg 2022-08-02 13:11:24.767585800 +0200 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.1.1 +current_version = 0.2.0 commit = True tag = True tag_name = {new_version} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyQt-0.1.1/setup.py new/AnyQt-0.2.0/setup.py --- old/AnyQt-0.1.1/setup.py 2022-06-13 12:58:54.000000000 +0200 +++ new/AnyQt-0.2.0/setup.py 2022-08-02 13:08:40.000000000 +0200 @@ -5,7 +5,7 @@ from setuptools import setup, find_packages NAME = "AnyQt" -VERSION = "0.1.1" +VERSION = "0.2.0" AUTHOR = "Ale?? Erjavec" AUTHOR_EMAIL = "ales.erja...@fri.uni-lj.si" URL = "https://github.com/ales-erjavec/anyqt"