-
Notifications
You must be signed in to change notification settings - Fork 33
Eliminate dependency on deprecated setuptools.pkg_resources #280
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
Changes from all commits
07c86ca
b94877a
000360a
0b64f34
41104c6
b9b8643
78a362b
f6edfdd
0f7ded7
26bae66
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import os | ||
from collections import namedtuple | ||
import pathlib | ||
import traceback | ||
|
||
import pkg_resources | ||
from backports.entry_points_selectable import entry_points | ||
|
||
from hotdoc.core.links import Link | ||
from hotdoc.utils.loggable import info, debug | ||
|
||
|
||
NS_MAP = {'core': 'http://www.gtk.org/introspection/core/1.0', | ||
|
@@ -200,16 +202,17 @@ def get_language_classes(): | |
Banana banana | ||
""" | ||
all_classes = {} | ||
deps_map = {} | ||
|
||
for entry_point in pkg_resources.iter_entry_points( | ||
group='hotdoc.extensions.gi.languages', name='get_language_classes'): | ||
for entry_point in entry_points( | ||
group='hotdoc.extensions.gi.languages', | ||
name='get_language_classes'): | ||
try: | ||
ep_name = entry_point.name | ||
activation_function = entry_point.load() | ||
classes = activation_function() | ||
# pylint: disable=broad-except | ||
except Exception as exc: | ||
info("Failed to load %s" % entry_point.module_name, exc) | ||
info("Failed to load %s" % str(entry_point), exc) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By the same token, |
||
debug(traceback.format_exc()) | ||
continue | ||
|
||
|
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 is here (despite
ep_name
never being used) because the results ofimportlib.metadata.entry_points()
are documented as not being validated; invoking any property is the suggested means of triggering validation.