Exemplo n.º 1
0
def iter_entry_points(group_name):
    try:
        from pip._vendor import pkg_resources
    except (ImportError, OSError):
        return []

    return pkg_resources.iter_entry_points(group_name)
Exemplo n.º 2
0
Arquivo: core.py Projeto: uranusjr/pdm
    def load_plugins(self):
        """Import and load plugins under `pdm.plugin` namespace
        A plugin is a callable that accepts the core object as the only argument.

        :Example:

        def my_plugin(core: pdm.core.Core) -> None:
            ...

        """
        for plugin in pkg_resources.iter_entry_points("pdm.plugin"):
            plugin.load()(self)