Skip to content

Replace usage of pkg_resources.iter_entry_points [2.11 version] #9013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev-v2.11
Choose a base branch
from

Conversation

amercader
Copy link
Member

2.11 version of #8992
Slightly more complex as the entry_point functions have different signatures on Python 3.9

amercader added 2 commits July 3, 2025 13:01
It is deprecated and to be removed soon:

```
UserWarning: pkg_resources is deprecated as an API. See
https://setuptools.pypa.io/en/latest/pkg_resources.html. The
pkg_resources package is slated for removal as early as 2025-11-30.
Refrain from using this package or pin to Setuptools<81.
```

Use `importlib.metadata` instead.
for ep in entry_points(group=SYSTEM_PLUGINS_ENTRY_POINT_GROUP): # type: ignore
ep.load()
eps.append(ep.name)
except TypeError:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the TypeError happen in the entry_points call? If so it would be better to not accidentally mask a TypeError from the load call. Same for the code below.

Copy link
Contributor

@wardi wardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the possible overly broad TypeError to fix and this is good to go.

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