elasticai.creator.plugin.read_specs_from_toml#
Provides ways to use and extend the elasticai.creator plugin system.
The plugin systems evolves around the
PluginLoaderclassPluginSymbolprotocolmeta.tomlfiles that describe the plugins
For convenience many functions convert the dicts loaded from the meta.toml file into PluginSpec objects.
The meta.toml file needs to define the value of each field of the PluginSpec class.
The function read_plugin_dicts_from_package will read all plugins from the plugins key in the meta.toml file of a package.
Example of a minimal meta.toml file
[[plugins]]
name = "minimal_plugin"
target_platform = "elastic-node-v5"
target_runtime = "vhdl"
version = "0.1"
api_version = "0.1"
The few minimal fields that a plugin is required to define shall allow plugin loaders to decide how to treat the plugin this could mean to
ignore the plugin
forward it to another software component
check if the plugin is not compatible with the current setup
The following table lists these required fields:
Field name |
Type |
Description |
name |
|
The name of the plugin, used to identify the plugin |
target platform |
|
A string describing the target platform for the plugin, ie. the lowering pass it should be loaded into. Currently there is no strict definition of the semantics of this string. |
target runtime |
|
A string the runtime context for the plugin. Currently there is no strict definition of the semantics of this string. |
version |
|
A version string in the form |
api_version |
|
The version of the plugin API (plugin system) that this plugin was developed against. This is used to check if the plugin is compatible with the current system. |
Warning
The set of required fields and their semantics is experimental and likely to change in the future.
The PluginLoader will read that description from the meta.toml file
in a given package and use a user provided function to decide which
symbols to load from which module.
Assuming that each of these symbols implements the PluginSymbol protocol,
it will then call load_into on each of these symbols with a plugin_receiver.
The plugin_receiver is provided by the user as well.
Most other classes defined in this module are supposed to increase usability and expressiveness.
Module Contents#
Functions#
read the meta.toml file from the package returning the list of plugin dictionaries. |