Skip to content

Commit fdae902

Browse files
authored
publicize end of life for cwltool on Python 2.7 (#1153)
1 parent ec2cf2d commit fdae902

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

cwltool/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
"""Reference implementation of the CWL standards."""
22
from __future__ import absolute_import
3+
import warnings
4+
import sys
35
__author__ = '[email protected]'
6+
7+
class CWLToolDeprecationWarning(Warning):
8+
pass
9+
10+
# Hate this?
11+
# set PYTHONWARNINGS=ignore:DEPRECATION::cwltool.__init__
12+
if sys.version_info < (3, 0):
13+
warnings.warn("""
14+
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020.
15+
Please upgrade your Python as the Python 2.7 version of cwltool won't be
16+
maintained after that date.
17+
""", category=CWLToolDeprecationWarning)

cwltool/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,6 @@ def main(argsl=None, # type: List[str]
572572
if os.path.isfile("CWLFile"):
573573
setattr(args, "workflow", "CWLFile")
574574
else:
575-
_logger.error("")
576575
_logger.error("CWL document required, no input file was provided")
577576
arg_parser().print_help()
578577
return 1

setup.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22
"""Setup for the reference implementation of the CWL standards."""
3+
from __future__ import print_function
34
import os
45
import sys
56

@@ -19,6 +20,13 @@
1920
NEEDS_PYTEST = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
2021
PYTEST_RUNNER = ['pytest-runner', 'pytest-cov'] if NEEDS_PYTEST else []
2122

23+
if sys.version_info < (3, 0):
24+
print("""
25+
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020.
26+
Please upgrade your Python as the Python 2.7 version of cwltool won't be
27+
maintained after that date.
28+
""", file=sys.stderr)
29+
2230
setup(name='cwltool',
2331
version='1.0',
2432
description='Common workflow language reference implementation',

0 commit comments

Comments
 (0)