Skip to content

Commit 16f4b11

Browse files
authored
Revert "Drop Python 3.6" (#1620)
* Revert "Drop Python 3.6" Ubuntu 18.04 (LTS, supported until April 2023) and Centos 7 are still on Python 3.6. This reverts commit 780f64a. * Review fixes and run 'make sort_imports'
1 parent ea1e434 commit 16f4b11

File tree

13 files changed

+68
-68
lines changed

13 files changed

+68
-68
lines changed

.github/workflows/ci-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
strategy:
2525
matrix:
2626
py-ver-major: [3]
27-
py-ver-minor: [7, 8, 9, 10]
27+
py-ver-minor: [6, 7, 8, 9, 10]
2828
step: [lint, unit, bandit, mypy]
2929

3030
env:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ shellcheck: FORCE
187187
cwltool-in-docker.sh
188188

189189
pyupgrade: $(PYSOURCES)
190-
pyupgrade --exit-zero-even-if-changed --py37-plus $^
190+
pyupgrade --exit-zero-even-if-changed --py36-plus $^
191191

192192
release-test: check-python3 FORCE
193193
git diff-index --quiet HEAD -- || ( echo You have uncommited changes, please commit them and try again; false )

README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ Quay.io (Docker): |Quay.io Container|
3333
.. |Total PyPI Downloads| image:: https://static.pepy.tech/personalized-badge/cwltool?period=total&units=international_system&left_color=black&right_color=orange&left_text=Total%20PyPI%20Downloads
3434
:target: https://pepy.tech/project/cwltool
3535

36-
.. |Conda Version| image:: https://anaconda.org/conda-forge/cwltool/badges/version.svg
36+
.. |Conda Version| image:: https://anaconda.org/conda-forge/cwltool/badges/version.svg
3737
:target: https://anaconda.org/conda-forge/cwltool
38-
38+
3939
.. |Conda Installs| image:: https://anaconda.org/conda-forge/cwltool/badges/downloads.svg
4040
:target: https://anaconda.org/conda-forge/cwltool
4141

@@ -84,7 +84,7 @@ If you encounter an error, first try to update package information by using
8484
sudo apt-get update
8585
8686
If you are running macOS X or other UNIXes and you want to use packages prepared by the conda-forge project, then
87-
please follow the install instructions for `conda-forge <https://conda-forge.org/#about>`_ (if you haven't already) and then
87+
please follow the install instructions for `conda-forge <https://conda-forge.org/#about>`_ (if you haven't already) and then
8888

8989
.. code:: bash
9090
@@ -142,11 +142,11 @@ system link or `another facility <https://wiki.debian.org/DebianAlternatives>`_.
142142
Recommended Software
143143
^^^^^^^^^^^^^^^^^^^^
144144

145-
You may also want to have the following installed:
145+
You may also want to have the following installed:
146146
- `node.js <https://nodejs.org/en/download/>`_
147147
- Docker, udocker, or Singularity (optional)
148148

149-
Without these, some examples in the CWL tutorials at http://www.commonwl.org/user_guide/ may not work.
149+
Without these, some examples in the CWL tutorials at http://www.commonwl.org/user_guide/ may not work.
150150

151151
Run on the command line
152152
-----------------------

cwltool/argparser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import argparse
44
import os
5+
import urllib
56
from typing import (
67
Any,
78
AnyStr,
@@ -16,7 +17,6 @@
1617
Union,
1718
cast,
1819
)
19-
import urllib
2020

2121
from schema_salad.ref_resolver import file_uri
2222

cwltool/context.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,14 @@
44
import shutil
55
import tempfile
66
import threading
7-
from typing import (
8-
IO,
9-
TYPE_CHECKING,
10-
Any,
11-
Callable,
12-
Dict,
13-
Iterable,
14-
List,
15-
Optional,
16-
TextIO,
17-
Union,
18-
)
7+
from typing import IO, Any, Callable, Dict, Iterable, List, Optional, TextIO, Union
198

9+
# move to a regular typing import when Python 3.3-3.6 is no longer supported
2010
from ruamel.yaml.comments import CommentedMap
2111
from schema_salad.avro.schema import Names
2212
from schema_salad.ref_resolver import Loader
2313
from schema_salad.utils import FetcherCallableType
14+
from typing_extensions import TYPE_CHECKING
2415

2516
from .builder import Builder
2617
from .mpi import MpiConfig

cwltool/job.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
Union,
3232
cast,
3333
)
34+
3435
import psutil
3536
import shellescape
3637
from prov.model import PROV

cwltool/provenance.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -247,22 +247,24 @@ def _valid_orcid(orcid: Optional[str]) -> str:
247247
"oa:motivatedBy": Dict[str, str],
248248
},
249249
)
250-
251-
252-
class Aggregate(TypedDict, total=False):
253-
uri: Optional[str]
254-
bundledAs: Optional[Dict[str, Any]]
255-
mediatype: Optional[str]
256-
conformsTo: Optional[Union[str, List[str]]]
257-
createdOn: Optional[str]
258-
createdBy: Optional[Dict[str, str]]
259-
260-
250+
Aggregate = TypedDict(
251+
"Aggregate",
252+
{
253+
"uri": Optional[str],
254+
"bundledAs": Optional[Dict[str, Any]],
255+
"mediatype": Optional[str],
256+
"conformsTo": Optional[Union[str, List[str]]],
257+
"createdOn": Optional[str],
258+
"createdBy": Optional[Dict[str, str]],
259+
},
260+
total=False,
261+
)
261262
# Aggregate.bundledAs is actually type Aggregate, but cyclic definitions are not suported
262-
class AuthoredBy(TypedDict, total=False):
263-
orcid: Optional[str]
264-
name: Optional[str]
265-
uri: Optional[str]
263+
AuthoredBy = TypedDict(
264+
"AuthoredBy",
265+
{"orcid": Optional[str], "name": Optional[str], "uri": Optional[str]},
266+
total=False,
267+
)
266268

267269

268270
class ResearchObject:

cwltool/utils.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,14 @@
101101
JSONType = Union[
102102
Dict[str, JSONAtomType], List[JSONAtomType], str, int, float, bool, None
103103
]
104-
105-
106-
class WorkflowStateItem(NamedTuple):
107-
parameter: CWLObjectType
108-
value: Optional[CWLOutputType]
109-
success: str
110-
104+
WorkflowStateItem = NamedTuple(
105+
"WorkflowStateItem",
106+
[
107+
("parameter", CWLObjectType),
108+
("value", Optional[CWLOutputType]),
109+
("success", str),
110+
],
111+
)
111112

112113
ParametersType = List[CWLObjectType]
113114
StepType = CWLObjectType # WorkflowStep

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ coloredlogs
1212
pydot>=1.4.1
1313
argcomplete>=1.12.0
1414
pyparsing != 3.0.2 # breaks --print-dot (pydot) https://github.com/pyparsing/pyparsing/issues/319
15+
pyparsing < 3;python_version<='3.6' # breaks --print-dot

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,13 @@
120120
"coloredlogs",
121121
"pydot >= 1.4.1",
122122
"pyparsing != 3.0.2", # breaks --print-dot (pydot) https://github.com/pyparsing/pyparsing/issues/319
123+
"pyparsing < 3 ;python_version<='3.6'", # breaks --print-dot (pydot)
123124
"argcomplete",
124125
],
125126
extras_require={
126127
"deps": ["galaxy-tool-util >= 21.1.0"],
127128
},
128-
python_requires=">=3.7, <4",
129+
python_requires=">=3.6, <4",
129130
setup_requires=PYTEST_RUNNER,
130131
test_suite="tests",
131132
tests_require=[
@@ -150,6 +151,7 @@
150151
"Operating System :: POSIX",
151152
"Operating System :: POSIX :: Linux",
152153
"Programming Language :: Python :: 3",
154+
"Programming Language :: Python :: 3.6",
153155
"Programming Language :: Python :: 3.7",
154156
"Programming Language :: Python :: 3.8",
155157
"Programming Language :: Python :: 3.9",

0 commit comments

Comments
 (0)