public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-readme-renderer] rawhide: Fix Python 3.15 compatibility (importlib.metadata description)
@ 2026-06-10 16:00 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-06-10 16:00 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/python-readme-renderer
            Branch : rawhide
            Commit : 8cf8c12164d73bc20ac72cae0a633414cdb166f8
            Author : Tomáš Hrnčiar <thrnciar@redhat.com>
            Date   : 2026-06-10T16:00:13+00:00
            Stats  : +30/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/python-readme-renderer/c/8cf8c12164d73bc20ac72cae0a633414cdb166f8?branch=rawhide

            Log:
            Fix Python 3.15 compatibility (importlib.metadata description)

Python 3.15 stores the package description in the Description header
field instead of the message payload. Try message["Description"] first,
falling back to get_payload() for older Python versions.

https://github.com/pypa/readme_renderer/pull/361

Assisted-by: Cursor

---
diff --git a/361.patch b/361.patch
new file mode 100644
index 0000000..0171142
--- /dev/null
+++ b/361.patch
@@ -0,0 +1,28 @@
+From 82b036b7218d90220ecf8e7681f3a27f2b18e714 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
+Date: Tue, 28 Apr 2026 09:15:27 +0200
+Subject: [PATCH] Fix CLI --package flag for Python 3.15+
+
+Python 3.15 synced importlib.metadata with importlib_metadata 8.7,
+which stores the package description in the Description header field
+instead of the message payload. Try the Description header first,
+falling back to get_payload() for older Python versions.
+
+Assisted-by: Cursor
+---
+ readme_renderer/__main__.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/readme_renderer/__main__.py b/readme_renderer/__main__.py
+index dd0db62..54d2177 100644
+--- a/readme_renderer/__main__.py
++++ b/readme_renderer/__main__.py
+@@ -24,7 +24,7 @@ def main(cli_args: Optional[list[str]] = None) -> None:
+     content_format = args.format
+     if args.package:
+         message = metadata(args.input)
+-        source = message.get_payload()  # type: ignore[attr-defined] # noqa: E501 https://peps.python.org/pep-0566/
++        source = message.get("Description") or message.get_payload()  # type: ignore[attr-defined] # noqa: E501 https://peps.python.org/pep-0566/
+ 
+         # Infer the format of the description from package metadata.
+         if not content_format:

diff --git a/python-readme-renderer.spec b/python-readme-renderer.spec
index a29f8c8..d2c86ed 100644
--- a/python-readme-renderer.spec
+++ b/python-readme-renderer.spec
@@ -15,6 +15,8 @@ Source:         %{pypi_source %{pypi_name}}
 Patch:          fix-tests-pygments-2.19.0.patch
 # Support docutils 0.22+
 Patch:          https://github.com/pypa/readme_renderer/pull/332.patch
+# Fix CLI --package for Python 3.15+ (importlib.metadata description change)
+Patch:          https://github.com/pypa/readme_renderer/pull/361.patch
 
 BuildArch:      noarch
 

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

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

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-10 16:00 [rpms/python-readme-renderer] rawhide: Fix Python 3.15 compatibility (importlib.metadata description) 

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