The containerize task does not work when Conda environments are specified. I put together a demonstration repository. Error has to do with os.fspath not recognizing the type (LocalSourceFile) of the Conda environment file.
My local Snakemake v6.8 (Python 3.9.7, CentOS 7) works just fine.
Traceback (most recent call last):
File "/opt/conda/envs/snakemake/lib/python3.9/site-packages/snakemake/__init__.py", line 602, in snakemake
workflow.containerize()
File "/opt/conda/envs/snakemake/lib/python3.9/site-packages/snakemake/workflow.py", line 1142, in containerize
containerize(self)
File "/opt/conda/envs/snakemake/lib/python3.9/site-packages/snakemake/deployment/containerize.py", line 27, in containerize
envs = sorted(
File "/opt/conda/envs/snakemake/lib/python3.9/site-packages/snakemake/deployment/containerize.py", line 25, in <lambda>
relfile = lambda env: os.path.relpath(env.file, os.getcwd())
File "/opt/conda/envs/snakemake/lib/python3.9/posixpath.py", line 456, in relpath
path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not LocalSourceFile
The
containerize
task does not work when Conda environments are specified. I put together a demonstration repository. Error has to do withos.fspath
not recognizing the type (LocalSourceFile
) of the Conda environment file.My local Snakemake v6.8 (Python 3.9.7, CentOS 7) works just fine.
Reproducible Example
Snakefile
envs/py39.yaml
.github/workflows/snakemake-containerize.yaml
Error