diff --git a/python-cloudpickle.changes b/python-cloudpickle.changes index 5733ea3..385673b 100644 --- a/python-cloudpickle.changes +++ b/python-cloudpickle.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Sep 25 05:14:58 UTC 2025 - Steve Kowalik + +- Add patch support-python-314.patch: + * Fix a test to pass under Python 3.14. + ------------------------------------------------------------------- Thu Jan 23 11:08:09 UTC 2025 - John Paul Adrian Glaubitz diff --git a/python-cloudpickle.spec b/python-cloudpickle.spec index 57f1bf8..06fed40 100644 --- a/python-cloudpickle.spec +++ b/python-cloudpickle.spec @@ -1,7 +1,7 @@ # # spec file for package python-cloudpickle # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2025 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,6 +24,8 @@ Summary: Extended pickling support for Python objects License: BSD-3-Clause URL: https://github.com/cloudpipe/cloudpickle Source: https://github.com/cloudpipe/cloudpickle/archive/refs/tags/v{%version}.tar.gz#/cloudpickle-%{version}-gh.tar.gz +# PATCH-FIX-UPSTREAM gh#cloudpipe/cloudpickle#570 +Patch0: support-python-314.patch BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module flit-core} BuildRequires: %{python_module pip} diff --git a/support-python-314.patch b/support-python-314.patch new file mode 100644 index 0000000..c82c3c3 --- /dev/null +++ b/support-python-314.patch @@ -0,0 +1,32 @@ +From d384a3b618d85fe5ae345c14bc46a5d1b48ba0ab Mon Sep 17 00:00:00 2001 +From: Victor Stinner +Date: Mon, 26 May 2025 20:29:09 +0200 +Subject: [PATCH] Fix #567: Fix test_locally_defined_class_with_type_hints() + +Update the test for Python 3.14 beta 1. What's New in Python 3.14 +says: + +"In previous releases, it was sometimes possible to access class +annotations from an instance of an annotated class. This behavior was +undocumented and accidental, and will no longer work in Python 3.14." + +https://docs.python.org/3.14/whatsnew/3.14.html#related-changes +--- + tests/cloudpickle_test.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tests/cloudpickle_test.py b/tests/cloudpickle_test.py +index 72aa132f..3647617d 100644 +--- a/tests/cloudpickle_test.py ++++ b/tests/cloudpickle_test.py +@@ -2658,7 +2658,9 @@ def method(self, arg: type_) -> type_: + MyClass.__annotations__ = {"attribute": type_} + + def check_annotations(obj, expected_type, expected_type_str): +- assert obj.__annotations__["attribute"] == expected_type ++ # On Python 3.14, it's no longer possible to access class ++ # annotations from an instance, so use type(). ++ assert type(obj).__annotations__["attribute"] == expected_type + assert obj.method.__annotations__["arg"] == expected_type + assert obj.method.__annotations__["return"] == expected_type + return "ok"