diff options
author | Tristan van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-05-20 19:17:10 +0900 |
---|---|---|
committer | Tristan van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-05-28 15:02:23 +0900 |
commit | 3f418029af80591d7a4592ee7e5a9312dfdf2d54 (patch) | |
tree | 4e4716ac33b864d7c65de8db23242335a296c54d /src/buildstream/_scheduler/jobs | |
parent | 1a85a6d5524a4eddaa6c0382fb936732c29fffb3 (diff) | |
download | buildstream-3f418029af80591d7a4592ee7e5a9312dfdf2d54.tar.gz |
_pluginfactory: Delegating the work of locating plugins to the PluginOrigin
This way we split up the logic of how to load plugins from different
origins into their respective classes.
This commit also:
o Introduces PluginType (which is currently either SOURCE or ELEMENT)
o Reduces the complexity of the PluginFactory constructor
o Kills the loaded_dependencies list and the all_loaded_plugins API,
and replaces both of these with a new list_plugins() API.
Consequently the jobpickler.py from the scheduler, and the
widget.py from the frontend, are updated to use list_plugins().
o Split up the PluginOrigin implementations into separate files
Instead of having all PluginOrigin classes in pluginorigin.py, split
it up into one base class and separate files for each implementation,
which is more inline with BuildStream coding style.
This has the unfortunate side effect of adding load_plugin_origin()
into the __init__.py file, because keeping new_from_node() as
a PluginOrigin class method cannot be done without introducing a
cyclic dependency with PluginOrigin and it's implementations.
Diffstat (limited to 'src/buildstream/_scheduler/jobs')
-rw-r--r-- | src/buildstream/_scheduler/jobs/jobpickler.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buildstream/_scheduler/jobs/jobpickler.py b/src/buildstream/_scheduler/jobs/jobpickler.py index 066e518c8..1ebad7d49 100644 --- a/src/buildstream/_scheduler/jobs/jobpickler.py +++ b/src/buildstream/_scheduler/jobs/jobpickler.py @@ -141,7 +141,7 @@ def _pickle_child_job_data(child_job_data, projects): ] plugin_class_to_factory = { - cls: factory for factory in factory_list if factory is not None for cls, _ in factory.all_loaded_plugins() + cls: factory for factory in factory_list if factory is not None for _, cls, _ in factory.list_plugins() } pickled_data = io.BytesIO() |