Skip to content

_pluginfactory/pluginoriginpip.py: Fix the description string#2076

Merged
gtristan merged 1 commit intomasterfrom
tristan/pip-origin-description
Oct 9, 2025
Merged

_pluginfactory/pluginoriginpip.py: Fix the description string#2076
gtristan merged 1 commit intomasterfrom
tristan/pip-origin-description

Conversation

@gtristan
Copy link
Contributor

@gtristan gtristan commented Oct 3, 2025

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.

This changes the following annoying output from bst build and other session commands:

    Source Plugins
        tar:      core plugin
        git_repo: junction: plugins/buildstream-plugins-community.bst (project directory: src/buildstream_plugins_community/sources)
        patch:    python package '<importlib.metadata.PathDistribution object at 0x7fc2d858cda0>' at: /usr/lib/python3.12/site-packages

To the following, more satisfying output:

    Source Plugins
        tar:      core plugin
        git_repo: junction: plugins/buildstream-plugins-community.bst (project directory: src/buildstream_plugins_community/sources)
        patch:    python package 'buildstream-plugins' version 2.5.0 at: /usr/lib/python3.12/site-packages

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.
@gtristan gtristan force-pushed the tristan/pip-origin-description branch from eaec573 to 9a5863e Compare October 9, 2025 07:44
@gtristan gtristan merged commit 045c25c into master Oct 9, 2025
14 checks passed
@gtristan gtristan deleted the tristan/pip-origin-description branch October 9, 2025 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants