From 9a5863e2f32f6f513587b2f6795bdc4d9c346040 Mon Sep 17 00:00:00 2001 From: Tristan van Berkom Date: Sat, 4 Oct 2025 00:21:38 +0900 Subject: [PATCH] _pluginfactory/pluginoriginpip.py: Fix the description string The `Distribution` object returned by importlib.metadata.distribution() does not have a sensible `__str__()` dunder method to rely on. Instead we should be using `Distribution.name` and `Distribution.version` members to describe the pip package which was loaded in the plugin description string. --- src/buildstream/_pluginfactory/pluginoriginpip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buildstream/_pluginfactory/pluginoriginpip.py b/src/buildstream/_pluginfactory/pluginoriginpip.py index a6174d080..2fe4563cd 100644 --- a/src/buildstream/_pluginfactory/pluginoriginpip.py +++ b/src/buildstream/_pluginfactory/pluginoriginpip.py @@ -101,7 +101,7 @@ def get_plugin_paths(self, kind, plugin_type): return ( os.path.dirname(location), str(defaults), - "python package '{}' at: {}".format(dist, dist.locate_file("")), + "python package '{}' version {} at: {}".format(dist.name, dist.version, dist.locate_file("")), ) def load_config(self, origin_node):