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: in rules from imported modules, exclude modified paths from module prefixing #1494

Merged
merged 11 commits into from Mar 23, 2022
29 changes: 29 additions & 0 deletions tests/test_module_no_prefixing_modified_paths/Snakefile
@@ -0,0 +1,29 @@
module module:
snakefile: "module/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 b from module2 as module2_b with:
input:
"test.txt"


rule joint_all:
input:
"test2.txt",
"test3.txt",
"test4.txt",
default_target: True
@@ -0,0 +1,2 @@
test_a
test_c
@@ -0,0 +1,5 @@
rule a:
output:
"test.txt"
shell:
"echo test_a > {output}"
17 changes: 17 additions & 0 deletions tests/test_module_no_prefixing_modified_paths/module2/Snakefile
@@ -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}
"""
7 changes: 7 additions & 0 deletions tests/tests.py
Expand Up @@ -1390,6 +1390,13 @@ def test_module_complex2():
run(dpath("test_module_complex2"), dryrun=True)


def test_module_no_prefixing_modified_paths():
run(
dpath(test_module_no_prefixing_modified_paths),
targets=["module2/test_final.txt"],
)


def test_module_with_script():
run(dpath("test_module_with_script"))

Expand Down