Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: wrong rule names when nesting module imports (#1817)
### Description Fix wrong rule names when nesting module imports. ### 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). --------- Co-authored-by: Johannes Köster <johannes.koester@tu-dortmund.de> Co-authored-by: Johannes Köster <johannes.koester@uni-due.de>
- Loading branch information
1 parent
b33aeec
commit 65c79a4
Showing
8 changed files
with
105 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
shell.executable("bash") | ||
|
||
|
||
module shallow_module: | ||
snakefile: | ||
"module_shallow.smk" | ||
|
||
|
||
use rule deep_work from shallow_module as shallow_work | ||
|
||
|
||
rule all: | ||
input: | ||
"foo.txt", | ||
default_target: True | ||
|
||
|
||
assert hasattr( | ||
rules, "shallow_work" | ||
), f"bug: rule cannot be accessed as shallow_work: {dir(rules)}" |
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 @@ | ||
I was here |
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,16 @@ | ||
# deep_module.smk | ||
rule all: | ||
input: | ||
"foo.txt", | ||
|
||
|
||
rule work: | ||
output: | ||
"foo.txt", | ||
shell: | ||
"echo 'I was here' > {output}" | ||
|
||
|
||
# rules.work has to work even if the rule is renamed in a parent module | ||
# The rulename itself can be already modified. | ||
assert hasattr(rules, "work"), f"bug: rule cannot be accessed as work: {dir(rules)}" |
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,19 @@ | ||
module deep_module: | ||
snakefile: | ||
"module_deep.smk" | ||
|
||
|
||
use rule work from deep_module as deep_work | ||
|
||
|
||
rule all: | ||
input: | ||
"foo.txt", | ||
default_target: True | ||
|
||
|
||
# rules.deep_work has to work even if the rule is renamed in a parent module | ||
# The rulename itself can be already modified. | ||
assert hasattr( | ||
rules, "deep_work" | ||
), f"bug: rule cannot be accessed as deep_work: {dir(rules)}" |
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