We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e06ff73 commit a3b850fCopy full SHA for a3b850f
pygeoapi/__init__.py
@@ -50,7 +50,20 @@ def _find_plugins():
50
"""
51
52
def decorator(click_group):
53
- for entry_point in entry_points(group="pygeoapi"):
+ try:
54
+ found_entrypoints = entry_points(group="pygeoapi")
55
+ except TypeError:
56
+ # earlier versions of importlib_metadata did not have the
57
+ # `group` kwarg. More detail:
58
+ #
59
+ # https://github.com/geopython/pygeoapi/issues/1241#issuecomment-1536128897 # noqa: E501
60
+ for group, entries in entry_points().items():
61
+ if group == "pygeoapi":
62
+ found_entrypoints = entries
63
+ break
64
+ else:
65
+ found_entrypoints = []
66
+ for entry_point in found_entrypoints:
67
try:
68
click_group.add_command(entry_point.load())
69
except Exception as err:
0 commit comments