public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/pythran] rawhide: Fix test failure with Python 3.15.0b1
@ 2026-06-03 10:05 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-06-03 10:05 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/pythran
Branch : rawhide
Commit : 34fbaa5862d61e67a55a25e8555bd5a6cb554643
Author : Miro Hrončok <miro@hroncok.cz>
Date   : 2026-05-26T16:56:48+02:00
Stats  : +66/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/pythran/c/34fbaa5862d61e67a55a25e8555bd5a6cb554643?branch=rawhide

Log:
Fix test failure with Python 3.15.0b1

---
diff --git a/2431.patch b/2431.patch
new file mode 100644
index 0000000..b3be25c
--- /dev/null
+++ b/2431.patch
@@ -0,0 +1,63 @@
+From c812d05ee79fa95556e44b30d292a60baf5ac04f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Tue, 26 May 2026 16:53:48 +0200
+Subject: [PATCH] Fix typing of array.typecodes for Python 3.15
+
+Python 3.15 changed array.typecodes from str to tuple to support
+type codes longer than 1 character (Zf and Zd).
+See https://github.com/python/cpython/issues/148675
+
+Pythran's fill_constants_types() uses type() introspection on live
+Python constants to set signatures, which now produces tuple instead
+of str. Meanwhile, the explicit ConstantIntr(signature=str) was
+silently ignored because ConstantIntr.__init__ never stored it.
+
+Fix ConstantIntr to preserve an explicitly provided signature, and
+skip introspection in fill_constants_types when one is already set.
+
+Without the fix, pytest pythran/tests/test_array.py -k test_typecodes
+fails with:
+
+        else:
+>           raise NotImplementedError(t)
+E           NotImplementedError: <class 'tuple'>
+
+pythran/types/tog.py:480: NotImplementedError
+
+Assisted-By: Claude Opus 4.6
+---
+ pythran/intrinsic.py | 2 ++
+ pythran/tables.py    | 7 ++++---
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/pythran/intrinsic.py b/pythran/intrinsic.py
+index f7566e4de..a5948c172 100644
+--- a/pythran/intrinsic.py
++++ b/pythran/intrinsic.py
+@@ -255,6 +255,8 @@ def __init__(self, **kwargs):
+         """ Forward arguments and remove arguments effects. """
+         kwargs["argument_effects"] = ()
+         super(ConstantIntr, self).__init__(**kwargs)
++        if 'signature' in kwargs:
++            self.signature = kwargs['signature']
+ 
+     def isliteral(self):
+         """ Mark this intrinsic as a literal. """
+diff --git a/pythran/tables.py b/pythran/tables.py
+index 64ca3d5c2..126656863 100644
+--- a/pythran/tables.py
++++ b/pythran/tables.py
+@@ -4731,9 +4731,10 @@ def fill_constants_types(module_name, elements):
+         if isinstance(intrinsic, dict):  # Submodule case
+             fill_constants_types(module_name + (elem,), intrinsic)
+         elif isinstance(intrinsic, ConstantIntr):
+-            # use introspection to get the Python constants types
+-            cst = getattr(import_module(".".join(module_name)), elem)
+-            intrinsic.signature = type(cst)
++            if not hasattr(intrinsic, 'signature'):
++                # use introspection to get the Python constants types
++                cst = getattr(import_module(".".join(module_name)), elem)
++                intrinsic.signature = type(cst)
+ 
+ 
+ fill_constants_types((), MODULES)

diff --git a/pythran.spec b/pythran.spec
index cdb5a0b..a6e36e9 100644
--- a/pythran.spec
+++ b/pythran.spec
@@ -58,6 +58,9 @@ Patch: https://github.com/serge-sans-paille/pythran/pull/2414.patch
 # Resolved upstream
 Patch: https://github.com/serge-sans-paille/pythran/pull/2415.patch
 
+# Fix typing of array.typecodes for Python 3.15
+Patch: https://github.com/serge-sans-paille/pythran/pull/2431.patch
+
 # there is no actual arched content
 # yet we want to test on all architectures
 # and we also might need to skip some

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-03 10:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-03 10:05 [rpms/pythran] rawhide: Fix test failure with Python 3.15.0b1 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox