From d357076c30fd74181524b831e57e8220d1dc58b78e162b3bf4b81c57e72567ff Mon Sep 17 00:00:00 2001 From: Christophe Giboudeaux Date: Mon, 28 Mar 2022 14:06:54 +0000 Subject: [PATCH] Accepting request 965385 from KDE:Qt:6.2 Qt 6.2.4 OBS-URL: https://build.opensuse.org/request/show/965385 OBS-URL: https://build.opensuse.org/package/show/KDE:Qt6/python3-pyside6?expand=0&rev=7 --- ...for-broken-QByteArray-__msetitem__-o.patch | 37 ---- ...ippets-for-QByteArray-__msetitem__-_.patch | 176 ------------------ pyside-setup-opensource-src-6.2.3.tar.xz | 3 - pyside-setup-opensource-src-6.2.4.tar.xz | 3 + python3-pyside6.changes | 9 + python3-pyside6.spec | 20 +- 6 files changed, 18 insertions(+), 230 deletions(-) delete mode 100644 0001-Prospective-fix-for-broken-QByteArray-__msetitem__-o.patch delete mode 100644 0002-Refactor-code-snippets-for-QByteArray-__msetitem__-_.patch delete mode 100644 pyside-setup-opensource-src-6.2.3.tar.xz create mode 100644 pyside-setup-opensource-src-6.2.4.tar.xz diff --git a/0001-Prospective-fix-for-broken-QByteArray-__msetitem__-o.patch b/0001-Prospective-fix-for-broken-QByteArray-__msetitem__-o.patch deleted file mode 100644 index c79cd19..0000000 --- a/0001-Prospective-fix-for-broken-QByteArray-__msetitem__-o.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 157e35b4a71f054ec1709f1651c7a6c53fc21815 Mon Sep 17 00:00:00 2001 -From: Friedemann Kleint -Date: Wed, 2 Feb 2022 18:07:07 +0100 -Subject: [PATCH 1/2] Prospective fix for broken QByteArray::__msetitem__() on - big endian architectures - -Remove a dubious cast from long to const char * which depends -on byte order. - -Pick-to: 6.2 5.15 -Fixes: PYSIDE-1804 -Change-Id: Iee2d809d4e9362b89439b9c56a5fb18e1f91d6fd ---- - sources/pyside6/PySide6/glue/qtcore.cpp | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/sources/pyside6/PySide6/glue/qtcore.cpp b/sources/pyside6/PySide6/glue/qtcore.cpp -index 5452e9f7f..05b4e7d2d 100644 ---- a/sources/pyside6/PySide6/glue/qtcore.cpp -+++ b/sources/pyside6/PySide6/glue/qtcore.cpp -@@ -643,9 +643,10 @@ if (PyIndex_Check(_key)) { - QByteArray temp; - if (PyLong_Check(item)) { - int overflow; -- long ival = PyLong_AsLongAndOverflow(item, &overflow); -- // Not suppose to bigger than 255 because only bytes, bytearray, QByteArray were accept -- temp = QByteArray(reinterpret_cast(&ival)); -+ const long ival = PyLong_AsLongAndOverflow(item, &overflow); -+ // Not supposed to be bigger than 255 because only bytes, -+ // bytearray, QByteArray were accepted -+ temp.append(char(ival)); - } else { - temp = %CONVERTTOCPP[QByteArray](item); - } --- -2.35.1 - diff --git a/0002-Refactor-code-snippets-for-QByteArray-__msetitem__-_.patch b/0002-Refactor-code-snippets-for-QByteArray-__msetitem__-_.patch deleted file mode 100644 index 1a8892c..0000000 --- a/0002-Refactor-code-snippets-for-QByteArray-__msetitem__-_.patch +++ /dev/null @@ -1,176 +0,0 @@ -From 9f0b47464bc757813384de84029e25857a54cc62 Mon Sep 17 00:00:00 2001 -From: Friedemann Kleint -Date: Wed, 2 Feb 2022 18:22:44 +0100 -Subject: [PATCH 2/2] Refactor code snippets for - QByteArray::__msetitem__()/__mgetitem__() - -Fix integer types, move variable declarations to initialization, -remove superfluous variables. - -As a drive-by, fix spelling in the test. - -Pick-to: 6.2 -Task-number: PYSIDE-1804 -Change-Id: I7ed4e69ae850a63d7e213a31cb078aa40e597fb2 ---- - sources/pyside6/PySide6/glue/qtcore.cpp | 49 ++++++++----------- - .../pyside6/tests/QtCore/qbytearray_test.py | 8 +-- - 2 files changed, 25 insertions(+), 32 deletions(-) - -diff --git a/sources/pyside6/PySide6/glue/qtcore.cpp b/sources/pyside6/PySide6/glue/qtcore.cpp -index 05b4e7d2d..693cad35c 100644 ---- a/sources/pyside6/PySide6/glue/qtcore.cpp -+++ b/sources/pyside6/PySide6/glue/qtcore.cpp -@@ -523,8 +523,7 @@ if (ret > 0 && ((strcmp(%1, SIGNAL(destroyed())) == 0) || (strcmp(%1, SIGNAL(des - - // @snippet qbytearray-mgetitem - if (PyIndex_Check(_key)) { -- Py_ssize_t _i; -- _i = PyNumber_AsSsize_t(_key, PyExc_IndexError); -+ const Py_ssize_t _i = PyNumber_AsSsize_t(_key, PyExc_IndexError); - if (_i < 0 || _i >= %CPPSELF.size()) { - PyErr_SetString(PyExc_IndexError, "index out of bounds"); - return 0; -@@ -535,10 +534,9 @@ if (PyIndex_Check(_key)) { - return PyBytes_FromStringAndSize(res, 1); - } - } else if (PySlice_Check(_key)) { -- Py_ssize_t start, stop, step, slicelength, cur; -- if (PySlice_GetIndicesEx(_key, %CPPSELF.count(), &start, &stop, &step, &slicelength) < 0) { -+ Py_ssize_t start, stop, step, slicelength; -+ if (PySlice_GetIndicesEx(_key, %CPPSELF.count(), &start, &stop, &step, &slicelength) < 0) - return nullptr; -- } - - QByteArray ba; - if (slicelength <= 0) { -@@ -547,15 +545,12 @@ if (PyIndex_Check(_key)) { - Py_ssize_t max = %CPPSELF.count(); - start = qBound(Py_ssize_t(0), start, max); - stop = qBound(Py_ssize_t(0), stop, max); -- QByteArray ba; - if (start < stop) - ba = %CPPSELF.mid(start, stop - start); - return %CONVERTTOPYTHON[QByteArray](ba); - } else { -- QByteArray ba; -- for (cur = start; slicelength > 0; cur += static_cast(step), slicelength--) { -+ for (Py_ssize_t cur = start; slicelength > 0; cur += step, --slicelength) - ba.append(%CPPSELF.at(cur)); -- } - return %CONVERTTOPYTHON[QByteArray](ba); - } - } else { -@@ -591,7 +586,7 @@ if (PyIndex_Check(_key)) { - PyErr_SetString(PyExc_ValueError, "bytearray must be of size 1"); - return -1; - } -- } else if (reinterpret_cast(Py_TYPE(_value)) == reinterpret_cast(SbkPySide6_QtCoreTypes[SBK_QBYTEARRAY_IDX])) { -+ } else if (Py_TYPE(_value) == reinterpret_cast(SbkPySide6_QtCoreTypes[SBK_QBYTEARRAY_IDX])) { - if (PyObject_Length(_value) != 1) { - PyErr_SetString(PyExc_ValueError, "QByteArray must be of size 1"); - return -1; -@@ -607,26 +602,24 @@ if (PyIndex_Check(_key)) { - PyObject *result = Sbk_QByteArrayFunc_insert(self, args); - Py_DECREF(args); - Py_XDECREF(result); -- return !result ? -1 : 0; -+ return result != nullptr ? 0: -1; - } else if (PySlice_Check(_key)) { -- Py_ssize_t start, stop, step, slicelength, value_length; -- if (PySlice_GetIndicesEx(_key, %CPPSELF.count(), &start, &stop, &step, &slicelength) < 0) { -+ Py_ssize_t start, stop, step, slicelength; -+ if (PySlice_GetIndicesEx(_key, %CPPSELF.count(), &start, &stop, &step, &slicelength) < 0) - return -1; -- } - // The parameter candidates are: bytes/str, bytearray, QByteArray itself. -- // Not support iterable which contains ints between 0~255 -+ // Not supported are iterables containing ints between 0~255 - - // case 1: value is nullpre, means delete the items within the range -- // case 2: step is 1, means shrink or expanse -+ // case 2: step is 1, means shrink or expand - // case 3: step is not 1, then the number of slots have to equal the number of items in _value -- QByteArray ba; -- if (_value == nullptr || _value == Py_None) { -- ba = QByteArray(); -- value_length = 0; -- } else if (!(PyBytes_Check(_value) || PyByteArray_Check(_value) || reinterpret_cast(Py_TYPE(_value)) == reinterpret_cast(SbkPySide6_QtCoreTypes[SBK_QBYTEARRAY_IDX]))) { -- PyErr_Format(PyExc_TypeError, "bytes, bytearray or QByteArray is required, not %.200s", Py_TYPE(_value)->tp_name); -- return -1; -- } else { -+ Py_ssize_t value_length = 0; -+ if (_value != nullptr && _value != Py_None) { -+ if (!(PyBytes_Check(_value) || PyByteArray_Check(_value) -+ || Py_TYPE(_value) == reinterpret_cast(SbkPySide6_QtCoreTypes[SBK_QBYTEARRAY_IDX]))) { -+ PyErr_Format(PyExc_TypeError, "bytes, bytearray or QByteArray is required, not %.200s", Py_TYPE(_value)->tp_name); -+ return -1; -+ } - value_length = PyObject_Length(_value); - } - -@@ -637,9 +630,9 @@ if (PyIndex_Check(_key)) { - } - - if (step != 1) { -- int i = start; -- for (int j = 0; j < slicelength; j++) { -- PyObject *item = PyObject_GetItem(_value, PyLong_FromLong(j)); -+ Py_ssize_t i = start; -+ for (Py_ssize_t j = 0; j < slicelength; ++j) { -+ PyObject *item = PyObject_GetItem(_value, PyLong_FromSsize_t(j)); - QByteArray temp; - if (PyLong_Check(item)) { - int overflow; -@@ -656,7 +649,7 @@ if (PyIndex_Check(_key)) { - } - return 0; - } else { -- ba = %CONVERTTOCPP[QByteArray](_value); -+ QByteArray ba = %CONVERTTOCPP[QByteArray](_value); - %CPPSELF.replace(start, slicelength, ba); - return 0; - } -diff --git a/sources/pyside6/tests/QtCore/qbytearray_test.py b/sources/pyside6/tests/QtCore/qbytearray_test.py -index c347a6e4d..ad8dc5382 100644 ---- a/sources/pyside6/tests/QtCore/qbytearray_test.py -+++ b/sources/pyside6/tests/QtCore/qbytearray_test.py -@@ -233,7 +233,7 @@ class QByteArraySliceAssignment(unittest.TestCase): - # shrink - b[2:8] = QByteArray(bytes('aaa', "UTF8")) - self.assertEqual(b, bytes('01aaa89', "UTF8")) -- # expanse -+ # expand - b[2:5] = QByteArray(bytes('uvwxyz', "UTF8")) - self.assertEqual(b, bytes('01uvwxyz89', "UTF8")) - # Delete behavior -@@ -241,7 +241,7 @@ class QByteArraySliceAssignment(unittest.TestCase): - self.assertEqual(b, bytes('0189', "UTF8")) - - b = QByteArray(bytes('0123456789', "UTF8")) -- # reverse assginment -+ # reverse assignment - b[5:2:-1] = QByteArray(bytes('ABC', "UTF8")) - self.assertEqual(b, bytes('012CBA6789', "UTF8")) - # step is not 1 -@@ -259,7 +259,7 @@ class QByteArraySliceAssignment(unittest.TestCase): - # shrink - b[2:8] = bytearray(bytes('aaa', "UTF8")) - self.assertEqual(b, bytes('01aaa89', "UTF8")) -- # expanse -+ # expand - b[2:5] = bytearray(bytes('uvwxyz', "UTF8")) - self.assertEqual(b, bytes('01uvwxyz89', "UTF8")) - # Delete behavior -@@ -267,7 +267,7 @@ class QByteArraySliceAssignment(unittest.TestCase): - self.assertEqual(b, bytes('0189', "UTF8")) - - b = QByteArray(bytes('0123456789', "UTF8")) -- # reverse assginment -+ # reverse assignment - b[5:2:-1] = bytearray(bytes('ABC', "UTF8")) - self.assertEqual(b, bytes('012CBA6789', "UTF8")) - # step is not 1 --- -2.35.1 - diff --git a/pyside-setup-opensource-src-6.2.3.tar.xz b/pyside-setup-opensource-src-6.2.3.tar.xz deleted file mode 100644 index 7e97433..0000000 --- a/pyside-setup-opensource-src-6.2.3.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:70d55e8fe977ffe094bba51119d16d37e0736df8693787110b127a2b4bd00003 -size 7626620 diff --git a/pyside-setup-opensource-src-6.2.4.tar.xz b/pyside-setup-opensource-src-6.2.4.tar.xz new file mode 100644 index 0000000..d3b12d0 --- /dev/null +++ b/pyside-setup-opensource-src-6.2.4.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9680ff298ee8b01a68de20911c60da04568a0918b3062d4c571ef170b4603ff +size 7630376 diff --git a/python3-pyside6.changes b/python3-pyside6.changes index 4c7a427..c9d74ab 100644 --- a/python3-pyside6.changes +++ b/python3-pyside6.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Mar 23 11:37:45 UTC 2022 - Christophe Giboudeaux + +- Update to 6.2.4 + https://code.qt.io/cgit/pyside/pyside-setup.git/tree/doc/changelogs/changes-6.2.4 +- Drop patches, now upstream: + * 0001-Prospective-fix-for-broken-QByteArray-__msetitem__-o.patch + * 0002-Refactor-code-snippets-for-QByteArray-__msetitem__-_.patch + ------------------------------------------------------------------- Thu Feb 3 15:43:44 UTC 2022 - Christophe Giboudeaux diff --git a/python3-pyside6.spec b/python3-pyside6.spec index 983e61c..ef9da62 100644 --- a/python3-pyside6.spec +++ b/python3-pyside6.spec @@ -24,13 +24,8 @@ %global pyside_flavor pyside6 %endif # -# llvm/clang are too old in Leap 15.2 -%if %{?suse_version} == 1500 && 0%{?sle_version} == 150200 -ExclusiveArch: do_not_build -%endif -# Name: python3-%{pyside_flavor} -Version: 6.2.3 +Version: 6.2.4 Release: 0 Summary: Python bindings for Qt 6 License: LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later) AND GPL-2.0-only AND GPL-3.0-only WITH Qt-GPL-exception-1.0 @@ -40,9 +35,6 @@ Source: https://download.qt.io/official_releases/QtForPython/pyside6/PyS Patch0: 0001-Don-t-install-CMake-files-into-versioned-directories.patch # PATCH-FIX-OPENSUSE Patch1: 0001-Always-link-to-python-libraries.patch -# PATCH-FIX-UPSTREAM -- big endian fixes -Patch2: 0001-Prospective-fix-for-broken-QByteArray-__msetitem__-o.patch -Patch3: 0002-Refactor-code-snippets-for-QByteArray-__msetitem__-_.patch # SECTION common_dependencies BuildRequires: clang-devel BuildRequires: fdupes @@ -191,12 +183,12 @@ export LD_LIBRARY_PATH=%{buildroot}%{_qt6_libdir}:$LD_LIBRARY_PATH %if "%{pyside_flavor}" == "pyside6" %define xvfb_command xvfb-run -s "-screen 0 1600x1200x16 -ac +extension GLX +render -noreset" \\ -# Excluded tests (last update: 2021-10-12) -# registry_existence_test can only be run if pyside and shiboken are built together -# QtWidgets_bug_635 fails +# Excluded tests (last update: 2022-03-23) +# registry_existence_test only works on the Qt CI # QtWebEngineWidgets_pyside-474-qtwebengineview & QtWebEngineCore_web_engine_custom_scheme -# pass locally but not on the build service -%define ctest_exclude_regex '(registry_existence_test|QtWidgets_bug_635|QtWebEngineWidgets_pyside-474-qtwebengineview|QtWebEngineCore_web_engine_custom_scheme)' +# pass locally but not on the build service (SIGTRAP) +# QtGui_qpen_test times out +%define ctest_exclude_regex '(registry_existence_test|QtWebEngineWidgets_pyside-474-qtwebengineview|QtWebEngineCore_web_engine_custom_scheme|QtGui_qpen_test)' %endif pushd sources/%{pyside_flavor}