Rules with scripts in nested paths fail when `--list-code-changes` set.

Create issue
Issue #1273 new
Former user created an issue

There's an assert in jobs.py that does not resolve rule script path correctly, causing the --list-code-changes to fail for any rules that are not defined in the top level directory and have a script.

The assert in question is here: https://bitbucket.org/snakemake/snakemake/src/56dade73ee707b3e3879a6bf6f5dc46cd82c4ce9/snakemake/jobs.py#lines-165

To reproduce, create the following directory tree:

- subfolder/script.py
- subfolder/test.smk
- foo
- Snakefile

subfolder/test.smk:

rule brokenscriptpaths:
    input: "foo"
    output: "bar"
    script: "script.py"

Snakefile

include: "subfolder/test.smk"

rule all:
    input: "bar"

The files foo and subfolder/script.py can be empty for the purposes of this example. With this directory structure

snakemake -np

will work as expected.

But

snakemake --list-code-changes

Changing the script path to subfolder/script.py in the rule will fix list code changes, but break the actual snakemake pipeline.

Comments (0)

  1. Log in to comment