Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix: in rules from imported modules, exclude modified paths from modu…
…le prefixing (#1494)
- Loading branch information
1 parent
9e92d63
commit 1e73db0
Showing
7 changed files
with
113 additions
and
27 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
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,27 @@ | ||
module module1: | ||
snakefile: "module1/Snakefile" | ||
config: config | ||
|
||
|
||
use rule * from module1 as module1_* | ||
|
||
|
||
# provide a prefix for all paths in module2 | ||
module module2: | ||
snakefile: "module2/Snakefile" | ||
config: config | ||
prefix: "module2" | ||
|
||
|
||
use rule * from module2 as module2_* | ||
|
||
# overwrite the input to remove the module2 prefix specified above | ||
use rule c from module2 as module2_c with: | ||
input: | ||
"test.txt" | ||
|
||
|
||
rule joint_all: | ||
input: | ||
"module2/test_final.txt", | ||
default_target: True |
2 changes: 2 additions & 0 deletions
2
tests/test_module_no_prefixing_modified_paths/expected-results/module2/test_final.txt
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,2 @@ | ||
test_a | ||
test_c |
5 changes: 5 additions & 0 deletions
5
tests/test_module_no_prefixing_modified_paths/module1/Snakefile
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,5 @@ | ||
rule a: | ||
output: | ||
"test.txt" | ||
shell: | ||
"echo test_a > {output}" |
17 changes: 17 additions & 0 deletions
17
tests/test_module_no_prefixing_modified_paths/module2/Snakefile
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,17 @@ | ||
rule b: | ||
output: | ||
"test.txt" | ||
shell: | ||
"echo test_b > {output}" | ||
|
||
|
||
rule c: | ||
input: | ||
"test.txt" | ||
output: | ||
"test_final.txt" | ||
shell: | ||
""" | ||
cp {input} {output}; | ||
echo test_c >> {output} | ||
""" |
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