From dae705cf64d9249a9e672c332ef4cae3c0dae40069517b90f63aae4b2b6cccc8 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 22 Jul 2024 10:16:19 +0000 Subject: [PATCH] Accepting request 1188977 from home:glaubitz:branches:devel:languages:python - Cherry-pick upstream patch to fix build with Python 3.13 * fix-python3.13-ftbfs.patch OBS-URL: https://build.opensuse.org/request/show/1188977 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Deprecated?expand=0&rev=20 --- fix-python3.13-ftbfs.patch | 42 ++++++++++++++++++++++++++++++++++++++ python-Deprecated.changes | 6 ++++++ python-Deprecated.spec | 5 ++++- 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 fix-python3.13-ftbfs.patch diff --git a/fix-python3.13-ftbfs.patch b/fix-python3.13-ftbfs.patch new file mode 100644 index 0000000..26e14dc --- /dev/null +++ b/fix-python3.13-ftbfs.patch @@ -0,0 +1,42 @@ +From 3b1aec9b8ff43f81cf7df9be92d0d383d759792e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Fri, 28 Jun 2024 07:52:59 +0200 +Subject: [PATCH] Update class method deprecation warnings for Python 3.13 + +Update the version range for modified deprecation warnings that was +introduced in efb3e60623e1dda88c2725a93223d290924e8666, since Python +3.13 reverted the change originally introduced in 3.9 and is back to +the old messages. This fixes tests with Python 3.13. + +See also https://github.com/GrahamDumpleton/wrapt/pull/260. +--- + tests/test_deprecated.py | 2 +- + tests/test_sphinx.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/test_deprecated.py b/tests/test_deprecated.py +index 0e467ae..c39229b 100644 +--- a/tests/test_deprecated.py ++++ b/tests/test_deprecated.py +@@ -191,7 +191,7 @@ def test_classic_deprecated_class_method__warns(classic_deprecated_class_method) + assert len(warns) == 1 + warn = warns[0] + assert issubclass(warn.category, DeprecationWarning) +- if sys.version_info >= (3, 9): ++ if (3, 9) <= sys.version_info < (3, 13): + assert "deprecated class method" in str(warn.message) + else: + assert "deprecated function (or staticmethod)" in str(warn.message) +diff --git a/tests/test_sphinx.py b/tests/test_sphinx.py +index a1d7753..8cf8e95 100644 +--- a/tests/test_sphinx.py ++++ b/tests/test_sphinx.py +@@ -301,7 +301,7 @@ def test_sphinx_deprecated_class_method__warns(sphinx_deprecated_class_method): + assert len(warns) == 1 + warn = warns[0] + assert issubclass(warn.category, DeprecationWarning) +- if sys.version_info >= (3, 9): ++ if (3, 9) <= sys.version_info < (3, 13): + assert "deprecated class method" in str(warn.message) + else: + assert "deprecated function (or staticmethod)" in str(warn.message) diff --git a/python-Deprecated.changes b/python-Deprecated.changes index fe920cd..a865b05 100644 --- a/python-Deprecated.changes +++ b/python-Deprecated.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jul 22 09:42:29 UTC 2024 - John Paul Adrian Glaubitz + +- Cherry-pick upstream patch to fix build with Python 3.13 + * fix-python3.13-ftbfs.patch + ------------------------------------------------------------------- Mon May 29 16:00:37 UTC 2023 - Dirk Müller diff --git a/python-Deprecated.spec b/python-Deprecated.spec index dafb390..9e3bde2 100644 --- a/python-Deprecated.spec +++ b/python-Deprecated.spec @@ -1,7 +1,7 @@ # # spec file for package python-Deprecated # -# 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 @@ -26,6 +26,8 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/tantale/deprecated Source: https://files.pythonhosted.org/packages/source/D/Deprecated/Deprecated-%{version}.tar.gz +# PATCH-FIX-UPSTREAM - gh#tantale/deprecated/73 - Update class method deprecation warnings for Python 3.13 +Patch: https://github.com/tantale/deprecated/pull/73.patch#/fix-python3.13-ftbfs.patch BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wrapt >= 1.10} @@ -42,6 +44,7 @@ you can use the ``@deprecated`` decorator. %prep %setup -q -n Deprecated-%{version} +%patch -P0 -p1 %build %python_build