Esempio n. 1
0
 def test_resolve_without_attr(self):
     ep = EntryPoint(
         name='ep',
         value='importlib.metadata',
         group='grp',
     )
     assert ep.load() is importlib.metadata
Esempio n. 2
0
def load_from_entry_point(entry_point: EntryPoint) -> Extension:
    """Carefully load the extension, raising a meaningful message in case of errors"""
    try:
        return entry_point.load()(entry_point.name)
    except Exception as ex:
        raise ErrorLoadingExtension(entry_point=entry_point) from ex