Package: src:aiofile
Version: 3.9.0-1.1
User: [email protected]
Usertags: python3.15
Tags: patch

Hi!

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

This is due to the way the module metadata is processed, that's already
fixed upstream and included since the release 3.10.1.

I'm attaching the upstream patch used in the sandbox to allow building
the packages that depend on aiofile.

Please consider including this patch or updating the package to the new
upstream release.

Happy hacking,

[1]: 
https://debusine.debian.net/debian/r-python-python3.15/work-request/1063575/
--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
Description: Fix KeyError when reading package metadata on Python 3.15
 PEP 621 authors table generates Author-email (e.g. "Name <email>")
 but not a standalone Author field. Similarly, license as an SPDX
 string maps to License-Expression, not License. Use .get() with
 fallbacks to handle both old and new metadata formats.
Origin: upstream, https://github.com/mosquito/aiofile/commit/c27fdc7e82756e87b8814cc0f9aedc21c0425487
Author: Paulus Schoutsen <[email protected]>, Yuri Konotopov <[email protected]>
Last-Update: 2026-08-21
--- a/aiofile/version.py
+++ b/aiofile/version.py
@@ -1,13 +1,26 @@
 import importlib.metadata
+from email.utils import parseaddr
 
 
 package_metadata = importlib.metadata.metadata("aiofile")
 
-__author__ = package_metadata["Author"]
+_author_email_raw = package_metadata.get("Author-email", "")
+_author_name, _author_email_addr = parseaddr(_author_email_raw)
+
+__author__ = package_metadata.get("Author", _author_name)
 __version__ = package_metadata["Version"]
-author_info = [(package_metadata["Author"], package_metadata["Author-email"])]
-package_info = package_metadata["Summary"]
-package_license = package_metadata["License"]
-project_home = package_metadata["Home-page"]
-team_email = package_metadata["Author-email"]
+author_info = [(__author__, _author_email_addr or _author_email_raw)]
+package_info = package_metadata.get("Summary", "")
+package_license = package_metadata.get(
+    "License-Expression", package_metadata.get("License", ""),
+)
+project_home = next(
+    (
+        url.split(",")[1].strip()
+        for url in package_metadata.get_all("Project-URL", [])
+        if "homepage" in url.lower()
+    ),
+    "",
+)
+team_email = _author_email_addr or _author_email_raw
 version_info = tuple(map(int, __version__.split(".")))

Reply via email to