-
Notifications
You must be signed in to change notification settings - Fork 146
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
Handle deprecation of pkg_resources and favor importlib #236
Conversation
Alternatively, manually installing @nickstenning as this is going to slowly start becoming more of an issue - any chance of a release? 🙂 |
try: | ||
from pkg_resources import iter_entry_points # Python 3.7-3.9 | ||
|
||
export_choices = dict((_export.name, _export) | ||
for _export in iter_entry_points('honcho_exporters')) | ||
except ImportError: | ||
from importlib.metadata import entry_points # Python 3.10+ | ||
|
||
export_choices = dict((_export.name, _export) | ||
for _export in entry_points(group='honcho_exporters')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should really be flipped -- prefer importlib.metadata
and if it's not available then fall back to (deprecated) pkg_resources
-- otherwise this will still trigger deprecation warnings even on systems where importlib.metadata
would avoid such warnings
Thank you for this! I've fixed this in #249 and will cut a release shortly. |
Specifically, the Python 3.10 images on CircleCI no longer include
pkg_resrouces
as it's deprecated:Starting in Python 3.8, importlib.metdata is the preferred way to find entry points.