Package: src:python-pipdeptree
Version: 2.30.0-1
User: [email protected]
Usertags: python3.15
Tags: patch, ftbfs, forky, sid
Severity: important

Hi!

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

The error is:
E       importlib.metadata.MetadataNotFound: No package metadata was found.

This is caused by a change in behavior in Python 3.15. To fix it, I applied a 
backport of the upstream commit fe58ab5: Expect dist.metadata to be None or 
raise an exception if invalid [2]

I've applied the upstream fix in the sandbox [3] to verify that it builds 
successfully, please consider applying the patch to support the upcoming 3.15 
version.

Setting the severity to important for now. Once Python 3.15 is released, it 
will be added to python3-defaults and this bug will become release critical.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4543463/
[2]: 
https://github.com/naiquevin/pipdeptree/commit/fe58ab592919a3bc7f0be199067956a422eee678
[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 /\/\ /\ >< `/
From: Lumír 'Frenzy' Balhar <[email protected]>
Date: Thu, 19 Mar 2026 17:56:07 +0100
Subject: Expect dist.metadata to be None or raise an exception if invalid
 (#554)

Co-authored-by: Bernát Gábor <[email protected]>
Co-authored-by: Miro Hrončok <[email protected]>
Origin: upstream, https://github.com/naiquevin/pipdeptree/commit/fe58ab592919a3bc7f0be199067956a422eee678
---
 src/pipdeptree/_discovery.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/pipdeptree/_discovery.py b/src/pipdeptree/_discovery.py
index b434040..e715895 100644
--- a/src/pipdeptree/_discovery.py
+++ b/src/pipdeptree/_discovery.py
@@ -116,7 +116,10 @@ def filter_valid_distributions(iterable_dists: Iterable[Distribution]) -> list[D
 
 
 def has_valid_metadata(dist: Distribution) -> bool:
-    return "Name" in dist.metadata
+    try:
+        return "Name" in dist.metadata
+    except (TypeError, FileNotFoundError):
+        return False
 
 
 def render_invalid_metadata_text(site_dirs_with_invalid_metadata: set[str]) -> None:

Reply via email to