From 6e6d043c2cfe7fef752d42591ff70255904042030aaf33d99411176ad2ddedc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Sat, 4 Feb 2023 10:58:10 +0000 Subject: [PATCH] Accepting request 1061720 from home:dirkmueller:Factory - add ba0d8cfcec3d3b0112d1c54991853e6003f2fbf6.patch to resolve python 3.11 build failure - add 0001-pypubsub-Replace-deprecated-inspect.getargspec.patch to fix another python 3.11 build failure OBS-URL: https://build.opensuse.org/request/show/1061720 OBS-URL: https://build.opensuse.org/package/show/X11:wxWidgets/python-wxPython?expand=0&rev=39 --- ...eplace-deprecated-inspect.getargspec.patch | 61 +++++++++++++++++++ ...8cfcec3d3b0112d1c54991853e6003f2fbf6.patch | 35 +++++++++++ python-wxPython.changes | 8 +++ python-wxPython.spec | 4 ++ 4 files changed, 108 insertions(+) create mode 100644 0001-pypubsub-Replace-deprecated-inspect.getargspec.patch create mode 100644 ba0d8cfcec3d3b0112d1c54991853e6003f2fbf6.patch diff --git a/0001-pypubsub-Replace-deprecated-inspect.getargspec.patch b/0001-pypubsub-Replace-deprecated-inspect.getargspec.patch new file mode 100644 index 0000000..1c273e2 --- /dev/null +++ b/0001-pypubsub-Replace-deprecated-inspect.getargspec.patch @@ -0,0 +1,61 @@ +From 9986a0d5c24b5d45ddf571d60351f68765a8a9be Mon Sep 17 00:00:00 2001 +From: Scott Talbert +Date: Mon, 8 Aug 2022 22:35:58 -0400 +Subject: [PATCH] pypubsub: Replace deprecated inspect.getargspec + +inspect.getargspec was removed in Python 3.11. This is a backport of: +https://github.com/schollii/pypubsub/commit/089c7a73f85c76a3aa22e4b10c71db1bf65a8637 +--- + wx/lib/pubsub/core/callables.py | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +diff --git a/wx/lib/pubsub/core/callables.py b/wx/lib/pubsub/core/callables.py +index 65eb1ebe..7e798c54 100644 +--- a/wx/lib/pubsub/core/callables.py ++++ b/wx/lib/pubsub/core/callables.py +@@ -12,7 +12,7 @@ CallArgsInfo regarding its autoTopicArgName data member. + + """ + +-from inspect import getargspec, ismethod, isfunction ++from inspect import ismethod, isfunction, signature, Parameter + + from .. import py2and3 + +@@ -133,19 +133,26 @@ class CallArgsInfo: + self.autoTopicArgName = None.""" + + #args, firstArgIdx, defaultVals, acceptsAllKwargs +- (allParams, varParamName, varOptParamName, defaultVals) = getargspec(func) +- if defaultVals is None: +- defaultVals = [] +- else: +- defaultVals = list(defaultVals) ++ allParams = [] ++ defaultVals = [] ++ varParamName = None ++ varOptParamName = None ++ for argName, param in signature(func).parameters.items(): ++ if param.default != Parameter.empty: ++ defaultVals.append(param.default) ++ if param.kind == Parameter.VAR_POSITIONAL: ++ varParamName = argName ++ elif param.kind == Parameter.VAR_KEYWORD: ++ varOptParamName = argName ++ else: ++ allParams.append(argName) + + self.acceptsAllKwargs = (varOptParamName is not None) + self.acceptsAllUnnamedArgs = (varParamName is not None) +- + self.allParams = allParams +- del self.allParams[0:firstArgIdx] # does nothing if firstArgIdx == 0 + + self.numRequired = len(self.allParams) - len(defaultVals) ++ assert len(self.allParams) >= len(defaultVals) + assert self.numRequired >= 0 + + # if listener wants topic, remove that arg from args/defaultVals +-- +2.39.0 + diff --git a/ba0d8cfcec3d3b0112d1c54991853e6003f2fbf6.patch b/ba0d8cfcec3d3b0112d1c54991853e6003f2fbf6.patch new file mode 100644 index 0000000..ae279a0 --- /dev/null +++ b/ba0d8cfcec3d3b0112d1c54991853e6003f2fbf6.patch @@ -0,0 +1,35 @@ +From ba0d8cfcec3d3b0112d1c54991853e6003f2fbf6 Mon Sep 17 00:00:00 2001 +From: Scott Talbert +Date: Mon, 7 Nov 2022 11:49:27 -0500 +Subject: [PATCH] wscript: Use EXT_SUFFIX when available to fix build on Py + 3.11 + +This is a backport of a an upstream fix in waf's check_python_headers(). + +See: https://gitlab.com/ita1024/waf/-/commit/8d6cbb3657bdbf2ad5ef33b8ba51f29747743e1d +--- + wscript | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/wscript b/wscript +index 6b53bcd5e..048a3df6d 100644 +--- a/wscript ++++ b/wscript +@@ -383,7 +383,7 @@ def my_check_python_headers(conf): + if not pybin: + conf.fatal('Could not find the python executable') + +- v = 'prefix SO LDFLAGS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHARED MACOSX_DEPLOYMENT_TARGET LDSHARED CFLAGS'.split() ++ v = 'prefix SO EXT_SUFFIX LDFLAGS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHARED MACOSX_DEPLOYMENT_TARGET LDSHARED CFLAGS'.split() + try: + lst = conf.get_python_variables(["get_config_var('%s') or ''" % x for x in v]) + except RuntimeError: +@@ -397,7 +397,7 @@ def my_check_python_headers(conf): + if dct[x]: + conf.env[x] = conf.environ[x] = dct[x] + +- env['pyext_PATTERN'] = '%s' + dct['SO'] # not a mistake ++ env['pyext_PATTERN'] = '%s' + (dct['EXT_SUFFIX'] or dct['SO']) # SO is deprecated in 3.5 and removed in 3.11 + + # Check for python libraries for embedding + all_flags = dct['LDFLAGS'] + ' ' + dct['CFLAGS'] diff --git a/python-wxPython.changes b/python-wxPython.changes index 67abe50..d494b10 100644 --- a/python-wxPython.changes +++ b/python-wxPython.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sat Jan 28 09:38:44 UTC 2023 - Dirk Müller + +- add ba0d8cfcec3d3b0112d1c54991853e6003f2fbf6.patch to resolve + python 3.11 build failure +- add 0001-pypubsub-Replace-deprecated-inspect.getargspec.patch + to fix another python 3.11 build failure + ------------------------------------------------------------------- Thu Jan 26 09:14:45 UTC 2023 - pgajdos@suse.com diff --git a/python-wxPython.spec b/python-wxPython.spec index 3ad51e3..18f4d3b 100644 --- a/python-wxPython.spec +++ b/python-wxPython.spec @@ -99,10 +99,14 @@ Patch2: 0001-Only-import-attrdict-where-needed.patch Patch4: 0003-Make-pip-usage-in-wxget-optional.patch # PATCH-FIX-OPENSUSE Patch5: 0004-Fix-time_t-ETG-typedef-extend-DateTime.FromTimeT-tes.patch +# PATCH-FIX-UPSTREAM - fix python 3.11 support +Patch6: https://github.com/wxWidgets/Phoenix/commit/ba0d8cfcec3d3b0112d1c54991853e6003f2fbf6.patch # PATCH-FIX-OPENSUSE - Test fixes/additions: Patch112: 0001-Check-HSV-values-in-image-test.patch # PATCH-FIX-UPSTREAM - https://github.com/wxWidgets/Phoenix/pull/2233 Patch113: 0001-Fix-overflow-check-for-wxUIntPtr-type.patch +# PATCH-FIX-UPSTREAM - https://github.com/wxWidgets/Phoenix/pull/2228 +Patch114: 0001-pypubsub-Replace-deprecated-inspect.getargspec.patch BuildRequires: %{python_module base} BuildRequires: %{python_module devel} BuildRequires: %{python_module requests}