Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix premature deletion of temp files in combination with checkpo…
…ints (#2737) fixes #2732 ### 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).
- Loading branch information
1 parent
e0a6be4
commit b22ba5f
Showing
5 changed files
with
56 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
rule a: | ||
output: | ||
temp("{name}.txt"), | ||
shell: | ||
"touch {output}" | ||
|
||
rule a1: | ||
input: | ||
"{name}.txt", | ||
output: | ||
temp("{name}.a1.out"), | ||
shell: | ||
"touch {output}" | ||
|
||
rule b1: | ||
input: | ||
"A.txt", | ||
output: | ||
temp("A.b1.out"), | ||
shell: | ||
"touch {output}" | ||
|
||
checkpoint b2: | ||
input: | ||
"A.b1.out" | ||
output: | ||
"A.b2.out" | ||
shell: | ||
"echo A > {output}" | ||
|
||
def in_func1(w): | ||
file = checkpoints.b2.get().output[0] | ||
return open(file, "r").read().strip() | ||
|
||
rule all: | ||
input: | ||
lambda w: expand(rules.a1.output, name=in_func1(w)), | ||
default_target: True |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters