Skip to content

Commit e8b682b

Browse files
fix: in addition to localrules statement, infer that job is local if it has any input or output file that is marked as local (#2541)
### QC <!-- Make sure that you can tick the boxes below. --> * [x] The PR contains a test case for the changes or the changes are already covered by an existing test case. * [x] The documentation (`docs/`) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).
1 parent d9231c3 commit e8b682b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

snakemake/jobs.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,14 @@ def properties(self, omit_resources=["_cores", "_nodes"], **aux_properties):
906906

907907
@property
908908
def is_local(self):
909-
return self.dag.workflow.is_local(self.rule)
909+
no_shared_fs = (
910+
SharedFSUsage.INPUT_OUTPUT
911+
not in self.dag.workflow.storage_settings.shared_fs_usage
912+
)
913+
return self.dag.workflow.is_local(self.rule) or (
914+
no_shared_fs
915+
and any(is_flagged(f, "local") for f in chain(self.input, self.output))
916+
)
910917

911918
def __repr__(self):
912919
return self.rule.name
@@ -1406,7 +1413,7 @@ def priority(self):
14061413

14071414
@property
14081415
def is_local(self):
1409-
return all(job.is_local for job in self.jobs)
1416+
return any(job.is_local for job in self.jobs)
14101417

14111418
def merged_wildcards(self):
14121419
jobs = iter(self.jobs)

0 commit comments

Comments
 (0)