diff --git a/snakemake_interface_executor_plugins/registry/__init__.py b/snakemake_interface_executor_plugins/registry/__init__.py index e8d1052..e0b34ab 100644 --- a/snakemake_interface_executor_plugins/registry/__init__.py +++ b/snakemake_interface_executor_plugins/registry/__init__.py @@ -57,3 +57,18 @@ def expected_attributes(self) -> Mapping[str, AttributeType]: kind=AttributeKind.CLASS, ), } + + def collect_plugins(self): + """Collect plugins and call register_plugin for each.""" + super().collect_plugins() + + try: + from snakemake.executors import local as local_executor + from snakemake.executors import dryrun as dryrun_executor + from snakemake.executors import touch as touch_executor + except ImportError: + # snakemake not present, proceed without adding these plugins + return + + for executor in [local_executor, dryrun_executor, touch_executor]: + self.register_plugin(executor.__name__, executor)