-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Currently the CLI side of queenbee supports a plugin architecture through the use of click-plugins however we do not use such a system for normal modules. ie: auth config classes and functions must all be defined in queenbee and cannot be imported from another plugin module.
This issue is raised in relation to this comment specifically. I agree that this is the preferable way forward but would like to tackle this issue properly at a later date so I can carry on with other dev work.
Some thoughts on plugin architecture reworks:
- Do it like the other ladybug-tools libraries using an importer in the
parentpackage init
"""Honeybee core library."""
import importlib
import pkgutil
from honeybee.logutil import get_logger
logger = get_logger(__name__)
# find and import honeybee extensions
# this is a critical step to add additional functionalities to honeybee core library.
extensions = {}
for finder, name, ispkg in pkgutil.iter_modules():
if not name.startswith('honeybee_') or name.count('_') > 1:
continue
try:
extensions[name] = importlib.import_module(name)
except Exception:
logger.exception('Failed to import {0}!'.format(name))
else:
logger.info('Successfully imported Honeybee plugin: {}'.format(name))- Use
popby the creator of saltstack. Here's a good pocast episode about it and here's their docs
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed