diff --git a/snakemake/workflow.py b/snakemake/workflow.py index 8354c44a4..74d10508e 100644 --- a/snakemake/workflow.py +++ b/snakemake/workflow.py @@ -1484,6 +1484,9 @@ def decorate(ruleinfo): rule=rule, ) + if isinstance(ruleinfo.conda_env, Path): + ruleinfo.conda_env = str(ruleinfo.conda_env) + if ( ruleinfo.conda_env is not None and is_conda_env_file(ruleinfo.conda_env) diff --git a/tests/test_conda/Snakefile b/tests/test_conda/Snakefile index 4f449adb3..06214a211 100644 --- a/tests/test_conda/Snakefile +++ b/tests/test_conda/Snakefile @@ -1,4 +1,5 @@ shell.executable("bash") +conda_env = Path("test-env.yaml") rule all: input: @@ -19,6 +20,6 @@ rule b: output: "test{i}.out2" conda: - "test-env.yaml" + conda_env shell: "Tm -h > {output} || true"