Skip to content

Commit b540e7c

Browse files
authored
retire use of pkg_resources (in miniwdl --version)
#794
1 parent 0fa23a5 commit b540e7c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

WDL/CLI.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,13 @@ def __call__(self, parser, namespace, values, option_string=None):
142142
else:
143143
print("miniwdl version unknown")
144144

145-
# show plugin versions
146-
# importlib_metadata doesn't seem to provide EntryPoint.dist to get from an entry point to
147-
# the metadata of the package providing it; continuing to use pkg_resources for this. Risk
148-
# that they give inconsistent results?
149-
import pkg_resources # type: ignore
145+
import importlib_metadata
150146

151147
for group in runtime.config.default_plugins().keys():
152148
group = f"miniwdl.plugin.{group}"
153-
for plugin in pkg_resources.iter_entry_points(group=group):
154-
print(f"{group}\t{plugin}\t{plugin.dist}")
149+
for plugin in importlib_metadata.entry_points(group=group):
150+
plugin_info = f"{plugin.dist.name} {plugin.dist.version}"
151+
print(f"{group}\t{plugin.name} = {plugin.value}\t{plugin_info}")
155152
sys.exit(0)
156153

157154

0 commit comments

Comments
 (0)