Skip to content

Commit 0b4ae2e

Browse files
fix: add testcase for script directive to work with Python 3.7 and corresponding fix.
1 parent fe188b3 commit 0b4ae2e

File tree

7 files changed

+21
-3
lines changed

7 files changed

+21
-3
lines changed

snakemake/settings.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
from abc import ABC
22
from dataclasses import dataclass, field
3-
from enum import Enum
4-
import importlib
53
from pathlib import Path
64
from typing import Optional
7-
from collections.abc import Mapping, Sequence, Set
5+
from typing import Mapping, Sequence, Set
86

97
import immutables
108

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
rule a:
2+
output:
3+
"test.out"
4+
conda:
5+
"env.yaml"
6+
script:
7+
"script.py"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
channels:
2+
- conda-forge
3+
- nodefaults
4+
dependencies:
5+
- python =3.7
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from snakemake.shell import shell
2+
print("test", file=open(snakemake.output[0], "w"))
3+
shell("echo test")

tests/tests.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,3 +1921,7 @@ def test_conda_global():
19211921

19221922
def test_missing_file_dryrun():
19231923
run(dpath("test_missing_file_dryrun"), executor="dryrun", shouldfail=True)
1924+
1925+
1926+
def test_script_pre_py39():
1927+
run(dpath("test_script_pre_py39"), deployment_method={DeploymentMethod.CONDA})

0 commit comments

Comments
 (0)