Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Adds fixes for the first two MREs in #823 #1215

Merged
merged 7 commits into from Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions snakemake/dag.py
Expand Up @@ -617,8 +617,13 @@ def unneeded_files():
yield from filterfalse(partial(needed, job_), tempfiles & files)

# temp output
if not job.dynamic_output and (
job not in self.targetjobs or job.rule.name == self.workflow.first_rule
if (
not job.dynamic_output
and not job.is_checkpoint
and (
job not in self.targetjobs
or job.rule.name == self.workflow.first_rule
)
):
tempfiles = (
f
Expand Down Expand Up @@ -1360,7 +1365,11 @@ def finish(self, job, update_dynamic=True):
self._running.remove(job)

# turn off this job's Reason
self.reason(job).mark_finished()
if job.is_group():
for j in job:
self.reason(j).mark_finished()
else:
self.reason(job).mark_finished()

try:
self._ready_jobs.remove(job)
Expand Down
27 changes: 27 additions & 0 deletions tests/test_issue823_1/Snakefile
@@ -0,0 +1,27 @@
rule all:
input:
"b.txt"

checkpoint a:
output:
# to reproduce the bug:
# >1 output required
# one or more temp() outputs required
# exception: will work if only the first output is temp()
temp('a1.txt'),
temp('a2.txt'),
shell:
"touch {output}"

def _checkpoint_output(wildcards):
out = checkpoints.a.get(**wildcards).output
return out

rule b:
input:
_checkpoint_output,
output:
'b.txt'
shell:
"touch {output}"

Empty file.
36 changes: 36 additions & 0 deletions tests/test_issue823_2/Snakefile
@@ -0,0 +1,36 @@
rule all:
input:
"c.txt",

checkpoint a:
output:
"a.txt"
shell:
"touch {output}"

rule b1:
output:
pipe("b.pipe")
shell:
"echo test > {output}"

rule b2:
input:
"b.pipe"
output:
"b.txt"
shell:
"""
cat {input} > /dev/null
touch {output}
"""

rule c:
input:
"a.txt",
"b.txt",
output:
"c.txt"
shell:
"touch {output}"

Empty file.
9 changes: 9 additions & 0 deletions tests/tests.py
Expand Up @@ -798,6 +798,15 @@ def test_issue805():
run(dpath("test_issue805"), shouldfail=True)


def test_issue823_1():
run(dpath("test_issue823_1"))


@skip_on_windows
def test_issue823_2():
run(dpath("test_issue823_2"))


@skip_on_windows
def test_pathlib():
run(dpath("test_pathlib"))
Expand Down