sierra.core.plugin#

SIERRA plugin management to make SIERRA OPEN/CLOSED.

Also contains checks that selected plugins implement the necessary classes and functions. Currently checkes: --storage, --execenv, and --engine.

Classes#

DirectoryPluginManager

Container for managing directory-based plugins.

Functions#

bc_load(cmdopts, category)

Load the specified Batch Criteria.

compare_sanity_checks(→ None)

Check the selected --compare plugins.

engine_sanity_checks(→ None)

Check the selected --engine plugin.

execenv_sanity_checks(→ None)

Check the selected --execenv plugin.

module_exists(→ bool)

Check if a module exists before trying to import it.

module_load(→ sierra.core.types.ModuleType)

Import the specified module.

module_load_tiered(→ sierra.core.types.ModuleType)

Attempt to load the specified python module with tiered precedence.

proc_sanity_checks(→ None)

Check the selected --proc plugins.

prod_sanity_checks(→ None)

Check the selected --prod plugins.

storage_sanity_checks(→ None)

Check the selected --storage plugin.

Module Contents#

class sierra.core.plugin.DirectoryPluginManager[source]#
Inheritance diagram of sierra.core.plugin.DirectoryPluginManager

Container for managing directory-based plugins.

load_plugin(name: str) None#

Load a plugin module.

sierra.core.plugin.bc_load(cmdopts: sierra.core.types.Cmdopts, category: str)[source]#

Load the specified Batch Criteria.

sierra.core.plugin.compare_sanity_checks(compare: str, module) None[source]#

Check the selected --compare plugins.

sierra.core.plugin.engine_sanity_checks(engine: str, module) None[source]#

Check the selected --engine plugin.

sierra.core.plugin.execenv_sanity_checks(execenv: str, module) None[source]#

Check the selected --execenv plugin.

sierra.core.plugin.module_exists(name: str) bool[source]#

Check if a module exists before trying to import it.

sierra.core.plugin.module_load(name: str) sierra.core.types.ModuleType[source]#

Import the specified module.

sierra.core.plugin.module_load_tiered(path: str, project: str | None = None, engine: str | None = None) sierra.core.types.ModuleType[source]#

Attempt to load the specified python module with tiered precedence.

Generally, the precedence is project -> project submodule -> engine module -> SIERRA core module, to allow users to override SIERRA core functionality with ease. Specifically:

  1. Check if the requested module directly exists. If it does, return it.

  2. Check if the requested module is a part of a project (i.e., <project>.<path> exists). If it does, return it. This requires that SIERRA_PLUGIN_PATH to be set properly.

  3. Check if the requested module is provided by the engine plugin (i.e., sierra.engine.<engine>.<path> exists). If it does, return it.

  4. Check if the requested module is part of the SIERRA core (i.e., sierra.core.<path> exists). If it does, return it.

If no match was found using any of these, throw an error.

sierra.core.plugin.proc_sanity_checks(proc: str, module) None[source]#

Check the selected --proc plugins.

sierra.core.plugin.prod_sanity_checks(prod: str, module) None[source]#

Check the selected --prod plugins.

sierra.core.plugin.storage_sanity_checks(medium: str, module) None[source]#

Check the selected --storage plugin.