Here is what I tried:
snakemake --use-conda --conda-frontend conda --containerize > dockerfile
This produces the following error:
File "/REDACTED/.conda/envs/snakemake/lib/python3.10/site-packages/snakemake/deployment/containerize.py", line 32, in containerize
envs = sorted(
File "/REDACTED/.conda/envs/snakemake/lib/python3.10/site-packages/snakemake/deployment/containerize.py", line 30, in relfile
return env.file.get_path_or_uri()
AttributeError: 'NoneType' object has no attribute 'get_path_or_uri'
Reproducible example is below:
Main snakefile:
configfile: "conf/config.yaml"
rule all:
input:
"output.txt"
include: "rules/test.smk"
test.smk snakefile:
rule test:
output:
"output.txt"
conda:
"biotools"
shell:
"""
python -VV > {output}
"""
Removing conda subcommand from the above works (obviously). Putting a file py38.yaml
in env
directory in rules
folder and replacing conda:"biotools"
with conda:"envs/py38.yaml"
works.
But I specifically want my container to include already named conda environments.
Do I really have to rewrite my workflow to replace all instances of conda:X
with conda:envs/X.yaml
and plop all my conda environs into .yaml
files?