diff --git a/pyproject.toml b/pyproject.toml index 14c99cb..b5941a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ version = "9.2.0" argparse-dataclass = "^2.0.0" python = "^3.11" throttler = "^1.2.2" -snakemake-interface-common = "^1.12.0" +snakemake-interface-common = "^1.17.4" [tool.poetry.dev-dependencies] black = "^24.0.0" 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)