Skip to content

Report rendering of rule fails if conda environment contains pip dependency #3084

@votti

Description

@votti

Snakemake version
8.20.3

Describe the bug
Checking the rule info of a rule in a generated report.html fails if the rule contains declared pip dependencies.

Logs
Using the inspection console in Chrome I find the following error when trying to access the rule info of an affected rule:
https://react.dev/errors/31?invariant=31&args%5B%5D=object%20with%20keys%20%7Bpip%7D

Minimal example
environment.yaml:

name: env-name
channels:
  - conda-forge
dependencies:
  - python
  - pip
  - pip:
    - cowsay

Snakefile:

rule say_hi:
    conda: 'environment.yml'
    output: 'hi.txt'
    shell:
        'python -m cowsay -t "Hello World" > {output}'

Command:
snakemake -c1 say_hi --use-conda
snakemake -c1 --report report.html

-> Open the report in Chrome, click on the rule say_hi -> page turns white
Additional context
My analysis is that the issue is that the pip section is nested while the react renderItems expects a flat list.

renderSoftware() {
let rule = rules[this.props.rule];
if (rule.conda_env) {
return this.renderItems("Software", rule.conda_env.dependencies);
} else {
return [];
}
}

I will try to fix this and make a PR shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions