-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make it possible to exclude rules that will be imported when us…
…ing 'use rule' statement (#1717) * feat: make it possible to exclude rules that will be imported when using 'use rule' statement * docs: update documentation * style: make black formatting happy
- Loading branch information
Showing
11 changed files
with
149 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
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,17 @@ | ||
shell.executable("bash") | ||
|
||
configfile: "config/config.yaml" | ||
|
||
|
||
module test: | ||
snakefile: | ||
"module-test/Snakefile" | ||
config: | ||
config | ||
replace_prefix: | ||
{"results/": "results/testmodule/"} | ||
|
||
|
||
use rule * from test as test_* | ||
|
||
assert test.some_func() == 15 |
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 @@ | ||
shell.executable("bash") | ||
|
||
configfile: "config/config.yaml" | ||
|
||
|
||
module test: | ||
snakefile: | ||
"module-test/Snakefile" | ||
config: | ||
config | ||
replace_prefix: | ||
{"results/": "results/testmodule/"} | ||
|
||
|
||
use rule * from test exclude b, d | ||
|
||
assert test.some_func() == 15 |
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,4 @@ | ||
test: 1 | ||
testb: 2 | ||
testc: 3 | ||
testd: 4 |
1 change: 1 addition & 0 deletions
1
tests/test_modules_all_exclude/expected-results/results/testmodule/test.out
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 @@ | ||
1 |
1 change: 1 addition & 0 deletions
1
tests/test_modules_all_exclude/expected-results/results/testmodule/test2.out
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 @@ | ||
3 |
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,35 @@ | ||
configfile: "config.yaml" # does not exist, but this statement should be ignored on module import | ||
|
||
|
||
def some_func(): | ||
return 15 | ||
|
||
|
||
rule all: | ||
input: | ||
"results/test.out", "results/test2.out" | ||
|
||
|
||
rule a: | ||
output: | ||
"results/test.out" | ||
shell: | ||
"echo {config[test]} > {output}" | ||
|
||
rule b: | ||
output: | ||
"results/test2.out" | ||
shell: | ||
"echo {config[testb]} > {output}" | ||
|
||
rule c: | ||
output: | ||
"results/test2.out" | ||
shell: | ||
"echo {config[testc]} > {output}" | ||
|
||
rule d: | ||
output: | ||
"results/test2.out" | ||
shell: | ||
"echo {config[testc]} > {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