public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-plaster] rawhide: Fix compatibility with Python 3.15
@ 2026-06-01 20:49 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-06-01 20:49 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/python-plaster
            Branch : rawhide
            Commit : 3cd0bd3b7fa8ba5f732c599504cefee4d1f47666
            Author : Tomáš Hrnčiar <thrnciar@redhat.com>
            Date   : 2026-06-01T17:00:50+02:00
            Stats  : +35/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/python-plaster/c/3cd0bd3b7fa8ba5f732c599504cefee4d1f47666?branch=rawhide

            Log:
            Fix compatibility with Python 3.15

Python 3.15 changed importlib.metadata to raise MetadataNotFound
(a FileNotFoundError subclass) when a distribution has no metadata
file, instead of returning None. This breaks plaster's loader
discovery which iterates all distributions unconditionally.

Assisted-by: Cursor

---
diff --git a/38.patch b/38.patch
new file mode 100644
index 0000000..4bf377d
--- /dev/null
+++ b/38.patch
@@ -0,0 +1,31 @@
+From ab612c84c4a92b32665ee5fa602fca40d340be48 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <tomas.hrnciar@me.com>
+Date: Mon, 1 Jun 2026 16:58:49 +0200
+Subject: [PATCH] Fix compatibility with Python 3.15
+
+Python 3.15 changed importlib.metadata to raise MetadataNotFound
+(a FileNotFoundError subclass) when a distribution has no metadata
+file, instead of returning None. This breaks plaster's loader
+discovery which iterates all distributions unconditionally.
+
+Assisted-by: Cursor
+---
+ src/plaster/loaders.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/plaster/loaders.py b/src/plaster/loaders.py
+index f7b10d1..cdfe97f 100644
+--- a/src/plaster/loaders.py
++++ b/src/plaster/loaders.py
+@@ -176,7 +176,10 @@ def _iter_ep_in_dists(scheme, groups):
+     # See https://github.com/Pylons/plaster/issues/25
+     dups = set()
+     for dist in metadata.distributions():
+-        name = dist.metadata["Name"]
++        try:
++            name = dist.metadata["Name"]
++        except FileNotFoundError:
++            continue
+         if name in dups:  # pragma: no cover
+             continue
+         dups.add(name)

diff --git a/python-plaster.spec b/python-plaster.spec
index fd0e20c..d281634 100644
--- a/python-plaster.spec
+++ b/python-plaster.spec
@@ -18,6 +18,9 @@ License: MIT
 Summary: %{sum}
 URL:     https://github.com/Pylons/%{srcname}
 Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
+# Skip distributions with missing metadata on Python 3.15+
+# MetadataNotFound (FileNotFoundError) is now raised instead of returning None
+Patch:  https://github.com/Pylons/plaster/pull/38.patch
 
 BuildRequires: make
 BuildRequires: python3-devel
@@ -44,7 +47,7 @@ Summary: %{sum}
 
 
 %prep
-%autosetup -n %{srcname}-%{version}
+%autosetup -p1 -n %{srcname}-%{version}
 
 %generate_buildrequires
 %pyproject_buildrequires -t

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

only message in thread, other threads:[~2026-06-01 20:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-01 20:49 [rpms/python-plaster] rawhide: Fix compatibility with Python 3.15 

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