ply: FTBFS against python 3.15rc1

Maximiliano Curia <[email protected]>
Newsgroups gmane.linux.debian.devel.python
Message-ID <[email protected]>
Package: src:ply
Version: 3.11-11
User: [email protected]
Usertags: python3.15
Tags: patch

Hi!

While rebuilding the python related packages against the Python 3.15rc1
version we found that ply fails to build from source [1]. 

 From the information in upstream's repository, ply has been discontinued
and won't be maintained anymore. However, there is a Pull Request that
has the necessary changes to fix this problem [2].

I've applied the PR fix in the sandbox [3] to be able to build the
packages that depend on ply, please consider applying the patch to
support the upcoming 3.15 version.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4341474/
[2]: https://github.com/dabeaz/ply/pull/318
[3]: https://debusine.debian.net/debian/r-python-python3.15

-- 
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
fix-testyacc.py.patch (text/x-diff, 985 B)
From 3ef4ef231342ca00f7f97772fea451c66aced03b Mon Sep 17 00:00:00 2001
From: Tom spot Callaway <[email protected]>
Date: Thu, 18 Dec 2025 10:39:22 -0500
Subject: [PATCH] Fix testyacc.py to work with Python 3.15

Signed-off-by: Tom spot Callaway <[email protected]>
---
 test/testyacc.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: ply/test/testyacc.py
===================================================================
--- ply.orig/test/testyacc.py
+++ ply/test/testyacc.py
@@ -22,7 +22,10 @@ def make_pymodule_path(filename):
     file = os.path.basename(filename)
     mod, ext = os.path.splitext(file)
 
-    if sys.hexversion >= 0x3040000:
+    if sys.hexversion >= 0x3050000:
+        import importlib.util
+        fullpath = importlib.util.cache_from_source(filename)
+    elif sys.hexversion >= 0x3040000:
         import importlib.util
         fullpath = importlib.util.cache_from_source(filename, ext=='.pyc')
     elif sys.hexversion >= 0x3020000:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.