-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLI: use factories in
PluginParamType
whenever possible
The `get_entry_point_from_string` method of the `PluginParamType` parameter type, tries to determine the entry point group and name from the value passed to the parameter and when matched, attempts to load the corresponding entry point. It was doing so by directly calling the `get_entry_point` method from the `aiida.plugins` module. Since the plugins that ship with `aiida-core` were recently updated to have them properly prefixed with `core.`, the old unprefixed entry point names are now deprecated. When used through the factories, the legacy entry point names are automatically detected and converted to the new one, with a deprecation warning being printed. However, the command line didn't have this functionality, since the `PluginParamType` was not going through the factories. Here, for the entry point groups that have a factory, the plugin param type is updated to use the factories, hence also automatically profiting from the deprecation pathway, allowing users to keep using the old entry point names for a while. The factories had to be modified slightly in order to make this work. Since the `PluginParamType` has the argument `load` which determines whether the matched entry point should be loaded or not, it should be able to pass this through to the factories, since this was always loading the entry point by default. For this reason, the factories now also have the `load` keyword argument. When set to false, the entry point itself is returned, instead of the resource that it points to. It is set to `True` by default to maintain backwards compatibility.
- Loading branch information
Showing
9 changed files
with
133 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.