15
0

Accepting request 1322605 from devel:languages:python

- Update to 3.1.2:
  * Fix pickling of abstract base classes containing type annotations
    for Python 3.14. (PR#578)
- Remove upstreamed patch support-python-314.patch

OBS-URL: https://build.opensuse.org/request/show/1322605
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cloudpickle?expand=0&rev=28
This commit is contained in:
2025-12-16 14:49:37 +00:00
committed by Git OBS Bridge
5 changed files with 12 additions and 38 deletions

Binary file not shown.

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7acae4307459d436eee740eea52ec9056f37b8b907d6aef7b0a97a1ccff90ff9
size 64055

View File

@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Dec 12 11:59:47 UTC 2025 - Daniel Garcia <daniel.garcia@suse.com>
- Update to 3.1.2:
* Fix pickling of abstract base classes containing type annotations
for Python 3.14. (PR#578)
- Remove upstreamed patch support-python-314.patch
-------------------------------------------------------------------
Thu Sep 25 05:14:58 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>

View File

@@ -18,14 +18,12 @@
%{?sle15_python_module_pythons}
Name: python-cloudpickle
Version: 3.1.1
Version: 3.1.2
Release: 0
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}

View File

@@ -1,32 +0,0 @@
From d384a3b618d85fe5ae345c14bc46a5d1b48ba0ab Mon Sep 17 00:00:00 2001
From: Victor Stinner <vstinner@python.org>
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"