Skip to content

Commit 7a8da9f

Browse files
authored
fix: convert conda env to string before checks (snakemake#1382)
1 parent 595945a commit 7a8da9f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

snakemake/workflow.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,6 +1484,9 @@ def decorate(ruleinfo):
14841484
rule=rule,
14851485
)
14861486

1487+
if isinstance(ruleinfo.conda_env, Path):
1488+
ruleinfo.conda_env = str(ruleinfo.conda_env)
1489+
14871490
if (
14881491
ruleinfo.conda_env is not None
14891492
and is_conda_env_file(ruleinfo.conda_env)

tests/test_conda/Snakefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
shell.executable("bash")
2+
conda_env = Path("test-env.yaml")
23

34
rule all:
45
input:
@@ -19,6 +20,6 @@ rule b:
1920
output:
2021
"test{i}.out2"
2122
conda:
22-
"test-env.yaml"
23+
conda_env
2324
shell:
2425
"Tm -h > {output} || true"

0 commit comments

Comments
 (0)