Skip to content

Commit 914372b

Browse files
committed
Drop support for Python 2.7 "workflows"
1 parent c60b607 commit 914372b

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

test/test_client_util.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
import sys
55
import unittest
66

7-
pkg_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) # noqa
8-
sys.path.insert(0, pkg_root) # noqa
9-
107
from wes_client.util import expand_globs, wf_info
118

129
logging.basicConfig(level=logging.INFO)
@@ -34,8 +31,8 @@ def setUp(self):
3431
self.expected = {
3532
"cwl": ("v1.0", "CWL"),
3633
"wdl": ("draft-2", "WDL"),
37-
"py": ("2.7", "PY"),
38-
"pyWithPrefix": ("2.7", "PY"),
34+
"py": ("3", "PY"),
35+
"pyWithPrefix": ("3", "PY"),
3936
}
4037

4138
def tearDown(self):

wes_client/util.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
from wes_service.util import visit
1313

1414

15-
def two_seven_compatible(filePath):
16-
"""Determines if a python file is 2.7 compatible by seeing if it compiles in a subprocess"""
15+
def py3_compatible(filePath):
16+
"""Determines if a python file is 3.x compatible by seeing if it compiles in a subprocess"""
1717
try:
18-
check_call(["python2", "-m", "py_compile", filePath], stderr=DEVNULL)
18+
check_call(["python3", "-m", "py_compile", filePath], stderr=DEVNULL)
1919
except CalledProcessError:
20-
raise RuntimeError("Python files must be 2.7 compatible")
20+
raise RuntimeError("Python files must be 3.x compatible")
2121
return True
2222

2323

2424
def get_version(extension, workflow_file):
2525
"""Determines the version of a .py, .wdl, or .cwl file."""
26-
if extension == "py" and two_seven_compatible(workflow_file):
27-
return "2.7"
26+
if extension == "py" and py3_compatible(workflow_file):
27+
return "3"
2828
elif extension == "cwl":
2929
return yaml.load(open(workflow_file), Loader=yaml.FullLoader)["cwlVersion"]
3030
else: # Must be a wdl file.

0 commit comments

Comments
 (0)