Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for importing plugins recursively from a plugin. #244

Open
entelecheia opened this issue Aug 26, 2023 · 0 comments
Open

Support for importing plugins recursively from a plugin. #244

entelecheia opened this issue Aug 26, 2023 · 0 comments
Labels
enhancement New feature or request [zube]: Inbox

Comments

@entelecheia
Copy link
Owner

hyfi/src/hyfi/core/core.py

Lines 187 to 208 in 16e1fe8

def init_plugins(self, plugins: List[str]) -> Dict[str, List[str]]:
"""Returns the list of plugins to load.
A plugin is a python module which contains a configuration module.
Args:
plugins: List[str]: A list of plugins to load.
Returns:
Dict[str, List[str]]: A dictionary of plugins to load. ex) plugins = {'__package_name__': ['plugin1.conf', 'plugin2.conf']}
"""
caller_pkg_name = PKGs.get_next_level_caller_package_name()
_plugins = []
for plugin in plugins:
plugin = plugin.split(".")[0]
if PKGs.is_importable(plugin):
logger.debug("Plugin %s is importable.", plugin)
config_module = f"{plugin}.{self.__config_dirname__}"
else:
logger.debug("Plugin %s is not importable.", plugin)
_plugins.append(config_module)
return {caller_pkg_name: _plugins}

@entelecheia entelecheia added enhancement New feature or request [zube]: Inbox labels Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request [zube]: Inbox
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant