Commit 2f954175 authored by Theophile GENTILHOMME's avatar Theophile GENTILHOMME

[utils] Function to get resources from entry point

parent 42108fc5
Pipeline #21683 passed with stage
in 27 minutes and 38 seconds
......@@ -586,3 +586,14 @@ def link_documentation(additional_packages = ['python', 'numpy'], requirements_f
print ("Path %s does not exist. The error was: %s" % (url, exc))
return mapping
def resource_keys(entry_point_group, exclude_packages=[], strip=['dummy']):
"""Reads and returns all resources that are registered with the given
entry_point_group.
Entry points from the given ``exclude_packages`` are ignored."""
ret_list = [entry_point.name for entry_point in
pkg_resources.iter_entry_points(entry_point_group)
if (entry_point.dist.project_name not in exclude_packages and
not entry_point.name.startswith(tuple(strip)))]
return sorted(ret_list)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment