From 1ec08ac40fcf3f86de53686dcbfb2b9f8931e07b09d9c6d42f5811f15fad33c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Wed, 17 Jan 2024 23:53:20 +0000 Subject: [PATCH 1/2] Accepting request 1138996 from home:dimstar:Factory - Enable python312 as valid multibuild flavor. OBS-URL: https://build.opensuse.org/request/show/1138996 OBS-URL: https://build.opensuse.org/package/show/X11:wxWidgets/python-wxPython?expand=0&rev=46 --- _multibuild | 1 + python-wxPython.changes | 5 +++++ python-wxPython.spec | 7 +++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/_multibuild b/_multibuild index 087b0f9..d8d93a5 100644 --- a/_multibuild +++ b/_multibuild @@ -4,4 +4,5 @@ python39 python310 python311 + python312 diff --git a/python-wxPython.changes b/python-wxPython.changes index ce2078c..4b0183f 100644 --- a/python-wxPython.changes +++ b/python-wxPython.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jan 15 16:29:26 UTC 2024 - Dominique Leuenberger + +- Enable python312 as valid multibuild flavor. + ------------------------------------------------------------------- Wed Dec 27 07:37:06 UTC 2023 - Antonio Larrosa diff --git a/python-wxPython.spec b/python-wxPython.spec index 11e84a2..e5746a3 100644 --- a/python-wxPython.spec +++ b/python-wxPython.spec @@ -1,7 +1,7 @@ # -# spec file for package python-wxPython +# spec file # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -57,6 +57,9 @@ ExclusiveArch: donotbuild %if "%flavor" != "python311" %define skip_python311 1 %endif +%if "%flavor" != "python312" +%define skip_python312 1 +%endif %else # SLE/Leap: python3 only %if "%flavor" != "python3" From c5aed123df2a71b75fa7fb87938c8b43348613ef3c1ec28611b96a316fcb4daa Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 18 Jan 2024 10:10:05 +0000 Subject: [PATCH 2/2] Accepting request 1137308 from home:bnavigator:branches:devel:languages:python - Update buildset: * Tumbleweed: Prepare python312, drop python38 * 15.X: Prepare for "SLE15 Python module pythons" (The repository does not have all the requirements yet to build) - Add 0001-wxWidgets-Phoenix-integer-division.patch * Required for Python 3.12 * gh#wxWidgets/Phoenix#2508 - Update requirements: * This version requires Pillow again. * Require numpy for all flavors: Add require-numpy.patch * Upstream goes back and forth, see https://github.com/wxWidgets/Phoenix/commits/master/requirements/install.txt - Repack the source: Remove stray wxWidgets-4.1.0 tree OBS-URL: https://build.opensuse.org/request/show/1137308 OBS-URL: https://build.opensuse.org/package/show/X11:wxWidgets/python-wxPython?expand=0&rev=47 --- 0001-wxWidgets-Phoenix-integer-division.patch | 25 +++++++++++++++++ _multibuild | 1 - python-wxPython.changes | 17 ++++++++++++ python-wxPython.spec | 27 ++++++++++++------- require-numpy.patch | 11 ++++++++ wxPython-4.2.1.tar.gz | 4 +-- 6 files changed, 73 insertions(+), 12 deletions(-) create mode 100644 0001-wxWidgets-Phoenix-integer-division.patch create mode 100644 require-numpy.patch diff --git a/0001-wxWidgets-Phoenix-integer-division.patch b/0001-wxWidgets-Phoenix-integer-division.patch new file mode 100644 index 0000000..6ea13d2 --- /dev/null +++ b/0001-wxWidgets-Phoenix-integer-division.patch @@ -0,0 +1,25 @@ +From 3b042c863f4092f802a877a972fd6eb284451a78 Mon Sep 17 00:00:00 2001 +From: Ben Greiner +Date: Sat, 6 Jan 2024 21:58:29 +0100 +Subject: [PATCH] integer division for randint + +Python 3.12 does not accept floats for random.randint() anymore +--- + unittests/test_dcDrawLists.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/unittests/test_dcDrawLists.py b/unittests/test_dcDrawLists.py +index 9e35e5eaf..6696a79a0 100644 +--- a/unittests/test_dcDrawLists.py ++++ b/unittests/test_dcDrawLists.py +@@ -63,8 +63,8 @@ def makeRandomRectangles(): + rects = [] + + for i in range(num): +- W = random.randint(10, w/2) +- H = random.randint(10, h/2) ++ W = random.randint(10, w//2) ++ H = random.randint(10, h//2) + x = random.randint(0, w - W) + y = random.randint(0, h - H) + rects.append( (x, y, W, H) ) diff --git a/_multibuild b/_multibuild index d8d93a5..4f9bf23 100644 --- a/_multibuild +++ b/_multibuild @@ -1,6 +1,5 @@ python3 - python38 python39 python310 python311 diff --git a/python-wxPython.changes b/python-wxPython.changes index 4b0183f..89e3f3e 100644 --- a/python-wxPython.changes +++ b/python-wxPython.changes @@ -3,6 +3,23 @@ Mon Jan 15 16:29:26 UTC 2024 - Dominique Leuenberger - Enable python312 as valid multibuild flavor. +------------------------------------------------------------------- +Sat Jan 6 21:47:42 UTC 2024 - Ben Greiner + +- Update buildset: + * Tumbleweed: Prepare python312, drop python38 + * 15.X: Prepare for "SLE15 Python module pythons" (The repository + does not have all the requirements yet to build) +- Add 0001-wxWidgets-Phoenix-integer-division.patch + * Required for Python 3.12 + * gh#wxWidgets/Phoenix#2508 +- Update requirements: + * This version requires Pillow again. + * Require numpy for all flavors: Add require-numpy.patch + * Upstream goes back and forth, see + https://github.com/wxWidgets/Phoenix/commits/master/requirements/install.txt +- Repack the source: Remove stray wxWidgets-4.1.0 tree + ------------------------------------------------------------------- Wed Dec 27 07:37:06 UTC 2023 - Antonio Larrosa diff --git a/python-wxPython.spec b/python-wxPython.spec index e5746a3..617d897 100644 --- a/python-wxPython.spec +++ b/python-wxPython.spec @@ -45,9 +45,6 @@ ExclusiveArch: donotbuild # Extraneous build_flavors and skips are excluded automatically so future # additions can be included here early and old flavors can be removed some time # after the global drop in Factory. -%if "%flavor" != "python38" -%define skip_python38 1 -%endif %if "%flavor" != "python39" %define skip_python39 1 %endif @@ -61,12 +58,17 @@ ExclusiveArch: donotbuild %define skip_python312 1 %endif %else -# SLE/Leap: python3 only -%if "%flavor" != "python3" -%define pythons %{nil} -%else +# SLE/Leap +%if "%flavor" == "python3" +# python3 is the old 3.6 %define pythons python3 %define python3_provides %{nil} +%else +%{?sle15_python_module_pythons} +%if "%flavor" != "%pythons" +# sle15_python_module_pythons defines the flavor, otherwise don't build +%define pythons %{nil} +%endif %endif %endif # The obs server-side interpreter cannot use lua or rpm shrink @@ -98,6 +100,8 @@ Patch1: 0001-Update-wxTextCtrl-OSX-overrides-since-they-re-now-do.patch Patch2: 0001-Handle-wxGLCanvas-CreateSurface-which-is-only-availa.patch # PATCH-FIX-UPSTREAM https://github.com/wxWidgets/Phoenix/pull/2497 Patch3: 0001-Support-building-with-Doxygen-1.9.7.patch +# PATCH-FIX-UPSTREAM https://github.com/wxWidgets/Phoenix/pull/2508 +Patch4: 0001-wxWidgets-Phoenix-integer-division.patch # PATCH-FIX-OPENSUSE Patch12: use_stl_build.patch # PATCH-FIX-UPSTREAM - https://github.com/wxWidgets/Phoenix/pull/2232 @@ -106,9 +110,11 @@ Patch13: 0003-Make-pip-usage-in-wxget-optional.patch Patch14: 0004-Fix-time_t-ETG-typedef-extend-DateTime.FromTimeT-tes.patch # PATCH-FIX-OPENSUSE - Test fixes/additions: Patch112: 0001-Check-HSV-values-in-image-test.patch +# PATCH-FIX-OPENSUSE - Numpy for Python 3.12 is a thing +Patch113: require-numpy.patch +# TODO: Replace deprecated setup.py calls in build.py with PEP517 without building wxWidgets into the wheel BuildRequires: %{python_module base} BuildRequires: %{python_module devel} -BuildRequires: %{python_module requests} BuildRequires: %{python_module setuptools} BuildRequires: c++_compiler BuildRequires: fdupes @@ -137,6 +143,8 @@ BuildRequires: pkgconfig(webkit2gtk-4.0) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xtst) %endif +Requires: %{pprefix}-Pillow +Requires: %{pprefix}-numpy Requires: %{pprefix}-six Requires(post): update-alternatives Requires(postun):update-alternatives @@ -150,6 +158,7 @@ Provides: %{python_provides}-wxWidgets = %{version} Obsoletes: %{python_provides}-wxPython < %{version}-%{release} %endif %if %{with test} +BuildRequires: %{python_module Pillow} BuildRequires: %{python_module numpy} BuildRequires: %{python_module pytest-forked} BuildRequires: %{python_module pytest-xdist} @@ -310,7 +319,7 @@ mv wx_temp wx %python_alternative %{_bindir}/wxdemo %python_alternative %{_bindir}/wxdocs %python_alternative %{_bindir}/wxget -%{python_sitearch}/wxPython-*-py*.egg-info +%{python_sitearch}/wxPython-%{version}-py*.egg-info %{python_sitearch}/wx/ %if %{without syswx} %exclude %{python_sitearch}/wx/locale/ diff --git a/require-numpy.patch b/require-numpy.patch new file mode 100644 index 0000000..c4895d1 --- /dev/null +++ b/require-numpy.patch @@ -0,0 +1,11 @@ +Revert https://github.com/wxWidgets/Phoenix/commit/b1c55639dfb73db3a11307c9de888540cec512df + +--- a/requirements/install.txt 2023-06-07 01:31:16.000000000 +0000 ++++ b/requirements/install.txt 2024-01-06 22:08:26.485981672 +0000 +@@ -1,5 +1,4 @@ + # Runtime dependencies needed when using wxPython Phoenix +-numpy < 1.17 ; python_version <= '2.7' +-numpy ; python_version >= '3.0' and python_version < '3.12' ++numpy + pillow + six diff --git a/wxPython-4.2.1.tar.gz b/wxPython-4.2.1.tar.gz index 6e2050d..e3b743f 100644 --- a/wxPython-4.2.1.tar.gz +++ b/wxPython-4.2.1.tar.gz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:750c7be19eb3e7fa1cb06cbeb71a26cf97f3d32ec9b40deb78e6e50a4d297253 -size 203383932 +oid sha256:aae4cca64cb53ef17f964c75ca8d1aaa1af12f33a0aaf1a483c5989537f6121a +size 72503592