diff --git a/pyproject.toml b/pyproject.toml index 5fcff41..a508be6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ license = { text = "MIT" } readme = "README.md" requires-python = ">=3.11" dependencies = [ - "snakemake-interface-common>=1.17.4", + "snakemake-interface-common>=1.19.0", "throttler>=1.2.2", "argparse-dataclass>=2.0.0", ] diff --git a/snakemake_interface_executor_plugins/executors/real.py b/snakemake_interface_executor_plugins/executors/real.py index 5a4c365..bfc072d 100644 --- a/snakemake_interface_executor_plugins/executors/real.py +++ b/snakemake_interface_executor_plugins/executors/real.py @@ -5,6 +5,8 @@ from abc import abstractmethod from typing import Dict + +from snakemake_interface_common import at_least_snakemake_version from snakemake_interface_executor_plugins.executors.base import ( AbstractExecutor, SubmittedJobInfo, @@ -79,32 +81,34 @@ def additional_general_args(self): def get_job_args(self, job: JobExecutorInterface, **kwargs): unneeded_temp_files = list(self.workflow.dag.get_unneeded_temp_files(job)) - return join_cli_args( - [ - format_cli_arg( - "--target-jobs", encode_target_jobs_cli_args(job.get_target_spec()) - ), - # Restrict considered rules for faster DAG computation. - # This does not work for updated jobs because they need - # to be updated in the spawned process as well. - format_cli_arg( - "--allowed-rules", - job.rules, - quote=False, - skip=job.is_updated, - ), - # Ensure that a group uses its proper local groupid. - format_cli_arg("--local-groupid", job.jobid, skip=not job.is_group()), - format_cli_arg("--cores", kwargs.get("cores", self.cores)), - format_cli_arg("--attempt", job.attempt), - format_cli_arg("--force-use-threads", not job.is_group()), - format_cli_arg( - "--unneeded-temp-files", - unneeded_temp_files, - skip=not unneeded_temp_files, - ), - ] - ) + arg_list = [ + format_cli_arg( + "--target-jobs", encode_target_jobs_cli_args(job.get_target_spec()) + ), + # Restrict considered rules for faster DAG computation. + format_cli_arg( + "--allowed-rules", + job.rules, + quote=False, + # Via this fix: https://github.com/snakemake/snakemake/pull/3640 + # --allowed-rules can be always used. The fix is released in + # snakemake 9.6.2. Before, --allowed-rules had to be skipped + # for jobs that have been updated after checkpoint evaluation. + skip=job.is_updated and not at_least_snakemake_version("9.6.2"), + ), + # Ensure that a group uses its proper local groupid. + format_cli_arg("--local-groupid", job.jobid, skip=not job.is_group()), + format_cli_arg("--cores", kwargs.get("cores", self.cores)), + format_cli_arg("--attempt", job.attempt), + format_cli_arg("--force-use-threads", not job.is_group()), + format_cli_arg( + "--unneeded-temp-files", + unneeded_temp_files, + skip=not unneeded_temp_files, + ), + ] + + return join_cli_args(arg_list) @property def job_specific_local_groupid(self):