Accepting request 1218616 from KDE:Qt6

- Add patches to fix issue found by the KDE CI (PYSIDE-2893)
  * 0001-PySide6-Documentation-Name-the-.rst-doc-files-accord.patch
  * 0001-build-Install-module-doc-snippet-files.patch

OBS-URL: https://build.opensuse.org/request/show/1218616
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python3-pyside6?expand=0&rev=36
This commit is contained in:
Ana Guerrero 2024-10-27 10:26:35 +00:00 committed by Git OBS Bridge
commit 627840ead2
4 changed files with 224 additions and 0 deletions

View File

@ -0,0 +1,99 @@
From 12aba6c4dfafe191a4640e3ab755a1c7e2ddfc44 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
Date: Tue, 15 Oct 2024 08:49:09 +0200
Subject: [PATCH] PySide6/Documentation: Name the .rst doc files according to
the module name
This makes installing them easier.
Amends b55e221464c18053fa44f18132071ebdaee8f432.
Task-number: PYSIDE-2893
Task-number: PYSIDE-1106
Change-Id: Ic93a1db34ca778ba1df8065c87e51e64e01c5900
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
(cherry picked from commit 9214d569d1e0765435a0df6a81a3996b93b3d044)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
sources/pyside6/PySide6/QtQml/typesystem_qml.xml | 16 ++++++++--------
.../doc/{qtqml_functions.rst => qtqml.rst} | 0
2 files changed, 8 insertions(+), 8 deletions(-)
rename sources/pyside6/PySide6/doc/{qtqml_functions.rst => qtqml.rst} (100%)
diff --git a/sources/pyside6/PySide6/QtQml/typesystem_qml.xml b/sources/pyside6/PySide6/QtQml/typesystem_qml.xml
index f2e9707c3..11eb27134 100644
--- a/sources/pyside6/PySide6/QtQml/typesystem_qml.xml
+++ b/sources/pyside6/PySide6/QtQml/typesystem_qml.xml
@@ -58,42 +58,42 @@
<add-function signature="qmlRegisterType(PyTypeObject@type_obj@,const char*@uri@,int@version_major@,int@version_minor@,const char*@qml_name@)" return-type="int">
<inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistertype"/>
- <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ <inject-documentation format="target" mode="append" file="../doc/qtqml.rst"
snippet="qmlregistertype"/>
<modify-argument index="2" pyi-type="str"/>
</add-function>
<add-function signature="qmlRegisterSingletonType(PyTypeObject@type_obj@,const char*@uri@,int@version_major@,int@version_minor@,const char*@qml_name@,PyObject*@callback@)" return-type="int">
<inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletontype_qobject_callback"/>
- <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ <inject-documentation format="target" mode="append" file="../doc/qtqml.rst"
snippet="qmlregistersingletontype_qobject_callback"/>
<modify-argument index="2" pyi-type="str"/>
</add-function>
<add-function signature="qmlRegisterSingletonType(PyTypeObject@type_obj@,const char*@uri@,int@version_major@,int@version_minor@,const char*@qml_name@)" return-type="int">
<inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletontype_qobject_nocallback"/>
- <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ <inject-documentation format="target" mode="append" file="../doc/qtqml.rst"
snippet="qmlregistersingletontype_qobject_nocallback"/>
<modify-argument index="2" pyi-type="str"/>
</add-function>
<add-function signature="qmlRegisterSingletonType(const char*@uri@,int@version_major@,int@version_minor@,const char*@qml_name@,PyObject*@callback@)" return-type="int">
<inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletontype_qjsvalue"/>
- <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ <inject-documentation format="target" mode="append" file="../doc/qtqml.rst"
snippet="qmlregistersingletontype_qjsvalue"/>
<modify-argument index="1" pyi-type="str"/>
</add-function>
<add-function signature="qmlRegisterSingletonInstance(PyTypeObject@type_obj@,const char*@uri@,int@version_major@,int@version_minor@,const char*@qml_name@,PyObject*@callback@)" return-type="int">
<inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregistersingletoninstance"/>
- <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ <inject-documentation format="target" mode="append" file="../doc/qtqml.rst"
snippet="qmlregistersingletoninstance"/>
<modify-argument index="2" pyi-type="str"/>
</add-function>
<add-function signature="qmlRegisterUncreatableType(PyTypeObject@type_obj@,const char*@uri@,int@version_major@,int@version_minor@,const char*@qml_name@,const char*@message@)" return-type="int">
<inject-code class="target" file="../glue/qtqml.cpp" snippet="qmlregisteruncreatabletype"/>
- <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ <inject-documentation format="target" mode="append" file="../doc/qtqml.rst"
snippet="qmlregisteruncreatabletype"/>
<modify-argument index="2" pyi-type="str"/>
</add-function>
@@ -229,7 +229,7 @@
</modify-argument>
<inject-code class="target" file="../glue/qtqml.cpp"
snippet="qqmlengine-singletoninstance-qmltypeid"/>
- <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ <inject-documentation format="target" mode="append" file="../doc/qtqml.rst"
snippet="qqmlengine-singletoninstance-qmltypeid"/>
</add-function>
<add-function signature="singletonInstance(QString@uri@,QString@typeName@)"
@@ -241,7 +241,7 @@
</modify-argument>
<inject-code class="target" file="../glue/qtqml.cpp"
snippet="qqmlengine-singletoninstance-typename"/>
- <inject-documentation format="target" mode="append" file="../doc/qtqml_functions.rst"
+ <inject-documentation format="target" mode="append" file="../doc/qtqml.rst"
snippet="qqmlengine-singletoninstance-typename"/>
</add-function>
</object-type>
diff --git a/sources/pyside6/PySide6/doc/qtqml_functions.rst b/sources/pyside6/PySide6/doc/qtqml.rst
similarity index 100%
rename from sources/pyside6/PySide6/doc/qtqml_functions.rst
rename to sources/pyside6/PySide6/doc/qtqml.rst
--
2.47.0

View File

@ -0,0 +1,115 @@
From cacc9c5803a6dec820dd46211a836453183c8dab Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
Date: Tue, 15 Oct 2024 08:11:46 +0200
Subject: [PATCH] build: Install module doc snippet files
Amends b55e221464c18053fa44f18132071ebdaee8f432.
Task-number: PYSIDE-1106
Fixes: PYSIDE-2893
Change-Id: I4a2688bfb5fcdddc5c6baea49d2fdc9c0f2381f1
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
(cherry picked from commit ad155e67a208d4ac4c20d7033701d6ddb3d2593e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
---
build_scripts/platforms/unix.py | 8 ++++----
build_scripts/platforms/windows_desktop.py | 7 +++----
build_scripts/wheel_files.py | 3 +++
sources/pyside6/cmake/Macros/PySideModules.cmake | 9 +++++++++
4 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/build_scripts/platforms/unix.py b/build_scripts/platforms/unix.py
index 2de089f32..4f57467cb 100644
--- a/build_scripts/platforms/unix.py
+++ b/build_scripts/platforms/unix.py
@@ -199,10 +199,10 @@ def prepare_packages_posix(pyside_build, _vars, cross_build=False):
# <install>/share/{st_package_name}/glue/* ->
# <setup>/{st_package_name}/glue
- copydir(
- "{install_dir}/share/{st_package_name}/glue",
- "{st_build_dir}/{st_package_name}/glue",
- _vars=_vars)
+ for glue in ['glue', 'doc']:
+ source = "{install_dir}/share/{st_package_name}/" + glue
+ target = "{st_build_dir}/{st_package_name}/" + glue
+ copydir(source, target, _vars=_vars)
if not is_android:
# <source>/pyside6/{st_package_name}/support/* ->
diff --git a/build_scripts/platforms/windows_desktop.py b/build_scripts/platforms/windows_desktop.py
index 2d2ff7db0..401930203 100644
--- a/build_scripts/platforms/windows_desktop.py
+++ b/build_scripts/platforms/windows_desktop.py
@@ -153,10 +153,9 @@ def prepare_packages_win32(pyside_build, _vars):
# <install>/share/{st_package_name}/glue/* ->
# <setup>/{st_package_name}/glue
- copydir(
- "{install_dir}/share/{st_package_name}/glue",
- destination_dir / "glue",
- _vars=_vars)
+ for glue in ['glue', 'doc']:
+ source = "{install_dir}/share/{st_package_name}/" + glue
+ copydir(source, destination_dir / glue, _vars=_vars)
# <source>/pyside6/{st_package_name}/support/* ->
# <setup>/{st_package_name}/support/*
diff --git a/build_scripts/wheel_files.py b/build_scripts/wheel_files.py
index 66e1f4182..9584949da 100644
--- a/build_scripts/wheel_files.py
+++ b/build_scripts/wheel_files.py
@@ -59,6 +59,7 @@ class ModuleData:
typesystems: list[str] = field(default_factory=list)
include: list[str] = field(default_factory=list)
glue: list[str] = field(default_factory=list)
+ doc_glue: list[str] = field(default_factory=list)
metatypes: list[str] = field(default_factory=list)
plugins: list[str] = field(default_factory=list)
@@ -87,6 +88,7 @@ class ModuleData:
self.typesystems.append(f"typesystem_{_lo}.xml")
self.include.append(f"Qt{self.name}/*.h")
self.glue.append(f"qt{_lo}.cpp")
+ self.doc_glue.append(f"qt{_lo}.rst")
if not len(self.metatypes):
self.metatypes.append(f"qt6{_lo}_relwithdebinfo_metatypes.json")
@@ -122,6 +124,7 @@ class ModuleData:
self.typesystems = [f"typesystems/{i}" for i in self.typesystems]
self.include = [f"include/{i}" for i in self.include]
self.glue = [f"glue/{i}" for i in self.glue]
+ self.doc_glue = [f"doc/{i}" for i in self.doc_glue]
def macos_pyside_wrappers_lib(self, s):
if s.startswith("Qt"):
diff --git a/sources/pyside6/cmake/Macros/PySideModules.cmake b/sources/pyside6/cmake/Macros/PySideModules.cmake
index 6e03323dd..57ff5582f 100644
--- a/sources/pyside6/cmake/Macros/PySideModules.cmake
+++ b/sources/pyside6/cmake/Macros/PySideModules.cmake
@@ -176,6 +176,14 @@ macro(create_pyside_module)
set(${module_NAME}_glue_dependency ${${module_NAME}_glue})
endif()
+ # Install module doc files.
+ set(${module_NAME}_doc "${CMAKE_CURRENT_SOURCE_DIR}/../doc/${lower_module_name}.rst")
+ set(${module_name}_doc_dependency "")
+ if(EXISTS ${${module_NAME}_doc})
+ install(FILES ${${module_NAME}_doc} DESTINATION share/PySide6${pyside6_SUFFIX}/doc)
+ set(${module_NAME}_doc_dependency ${${module_NAME}_doc})
+ endif()
+
# Install standalone glue files into typesystems subfolder, so that the resolved relative
# paths remain correct.
if (module_GLUE_SOURCES)
@@ -245,6 +253,7 @@ macro(create_pyside_module)
DEPENDS ${total_type_system_files}
${module_GLUE_SOURCES}
${${module_NAME}_glue_dependency}
+ ${${module_NAME}_doc_dependency}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Running generator for ${module_NAME}...")
--
2.47.0

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Sat Oct 26 21:29:14 UTC 2024 - Christophe Marin <christophe@krop.fr>
- Add patches to fix issue found by the KDE CI (PYSIDE-2893)
* 0001-PySide6-Documentation-Name-the-.rst-doc-files-accord.patch
* 0001-build-Install-module-doc-snippet-files.patch
-------------------------------------------------------------------
Mon Oct 14 11:35:35 UTC 2024 - Fabian Vogt <fvogt@suse.com>

View File

@ -57,6 +57,9 @@ Patch1: fix-pytest-qt.patch
Patch2: 0001-Lazy-Init-Support-Lazy-Subtypes-amended.patch
# PATCH-FIX-UPSTREAM
Patch3: 0001-signature-Fix-pointers-to-signature-bytes-with-the-h.patch
# PATCH-FIX-UPSTREAM
Patch4: 0001-PySide6-Documentation-Name-the-.rst-doc-files-accord.patch
Patch5: 0001-build-Install-module-doc-snippet-files.patch
# SECTION common_dependencies
BuildRequires: clang-devel
BuildRequires: %{mypython}-Sphinx