public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/python-readme-renderer] rawhide: Fix Python 3.15 compatibility (importlib.metadata description)
Date: Wed, 10 Jun 2026 16:00:24 GMT	[thread overview]
Message-ID: <178110722426.1.8095930083156129879.rpms-python-readme-renderer-8cf8c12164d7@fedoraproject.org> (raw)

            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
 

                 reply	other threads:[~2026-06-10 16:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178110722426.1.8095930083156129879.rpms-python-readme-renderer-8cf8c12164d7@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox