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

13 files changed

+68
-68
lines changed

.github/workflows/ci-tests.yml

+1-1
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

+1-1
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

+5-5
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

+1-1
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

+3-12
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

+1
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

+17-15
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

+8-7
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

+1
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

+3-1
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",

tests/test_stdout_stderr_log_dir.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import os
21
import json
2+
import os
33
from pathlib import Path
44

55
from cwltool.main import main

tests/util.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ def env_accepts_null() -> bool:
6666
if _env_accepts_null is None:
6767
result = subprocess.run(
6868
["env", "-0"],
69-
capture_output=True,
69+
stdout=subprocess.PIPE,
70+
stderr=subprocess.PIPE,
7071
encoding="utf-8",
7172
)
7273
_env_accepts_null = result.returncode == 0

tox.ini

+24-23
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[tox]
22
envlist =
3-
py3{7,8,9,10}-lint
4-
py3{7,8,9,10}-unit
5-
py3{7,8,9,10}-bandit
6-
py3{7,8,9,10}-mypy
3+
py3{6,7,8,9,10}-lint
4+
py3{6,7,8,9,10}-unit
5+
py3{6,7,8,9,10}-bandit
6+
py3{6,7,8,9,10}-mypy
77
py39-lintreadme
88
py39-shellcheck
99
py39-pydocstyle
@@ -16,20 +16,21 @@ testpaths = tests
1616

1717
[gh-actions]
1818
python =
19+
3.6: py36
1920
3.7: py37
2021
3.8: py38
2122
3.9: py39
2223
3.10: py310
2324

2425
[testenv]
2526
skipsdist =
26-
py3{7,8,9,10}-!{unit,mypy,lintreadme} = True
27+
py3{6,7,8,9,10}-!{unit,mypy,lintreadme} = True
2728

2829
description =
29-
py3{7,8,9,10}-unit: Run the unit tests
30-
py3{7,8,9,10}-lint: Lint the Python code
31-
py3{7,8,9,10}-bandit: Search for common security issues
32-
py3{7,8,9,10}-mypy: Check for type safety
30+
py3{6,7,8,9,10}-unit: Run the unit tests
31+
py3{6,7,8,9,10}-lint: Lint the Python code
32+
py3{6,7,8,9,10}-bandit: Search for common security issues
33+
py3{6,7,8,9,10}-mypy: Check for type safety
3334
py39-pydocstyle: docstring style checker
3435
py39-shellcheck: syntax check for shell scripts
3536
py39-lintreadme: Lint the README.rst→.md conversion
@@ -40,39 +41,39 @@ passenv =
4041
PROOT_NO_SECCOMP
4142

4243
extras =
43-
py3{7,8,9,10}-unit: deps
44+
py3{6,7,8,9,10}-unit: deps
4445

4546
deps =
46-
py3{7,8,9,10}-{unit,lint,bandit,mypy}: -rrequirements.txt
47-
py3{7,8,9,10}-{unit,mypy}: -rtest-requirements.txt
48-
py3{7,8,9,10}-lint: -rlint-requirements.txt
49-
py3{7,8,9,10}-bandit: bandit
50-
py3{7,8,9,10}-bandit: importlib_metadata != 4.8.0
51-
py3{7,8,9,10}-mypy: -rmypy-requirements.txt
47+
py3{6,7,8,9,10}-{unit,lint,bandit,mypy}: -rrequirements.txt
48+
py3{6,7,8,9,10}-{unit,mypy}: -rtest-requirements.txt
49+
py3{6,7,8,9,10}-lint: -rlint-requirements.txt
50+
py3{6,7,8,9,10}-bandit: bandit
51+
py3{6,7,8,9,10}-bandit: importlib_metadata != 4.8.0
52+
py3{6,7,8,9,10}-mypy: -rmypy-requirements.txt
5253
py39-pydocstyle: pydocstyle
5354
py39-pydocstyle: diff-cover
5455
py39-lintreadme: twine
5556
py39-lintreadme: wheel
5657
py39-lintreadme: readme_renderer[md]
5758

5859
setenv =
59-
py3{7,8,9,10}-unit: LC_ALL = C.UTF-8
60+
py3{6,7,8,9,10}-unit: LC_ALL = C.UTF-8
6061

6162
commands_pre =
62-
py3{7,8,9,10}-unit: python -m pip install -U pip setuptools wheel
63+
py3{6,7,8,9,10}-unit: python -m pip install -U pip setuptools wheel
6364
py39-lintreadme: python setup.py sdist --dist-dir {distdir}
6465
py39-lintreadme: python setup.py bdist_wheel --dist-dir {distdir}
6566

6667
commands =
67-
py3{7,8,9,10}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs}
68-
py3{7,8,9,10}-bandit: bandit -r cwltool
69-
py3{7,8,9,10}-lint: make flake8 format-check
70-
py3{7,8,9,10}-mypy: make mypy mypyc PYTEST_EXTRA={posargs}
68+
py3{6,7,8,9,10}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs}
69+
py3{6,7,8,9,10}-bandit: bandit -r cwltool
70+
py3{6,7,8,9,10}-lint: make flake8 format-check
71+
py3{6,7,8,9,10}-mypy: make mypy mypyc PYTEST_EXTRA={posargs}
7172
py39-shellcheck: make shellcheck
7273
py39-pydocstyle: make diff_pydocstyle_report
7374
py39-lintreadme: twine check {distdir}/*
7475

7576
skip_install =
76-
py3{7,8,9,10}-{bandit,lint,mypy,shellcheck,pydocstyle,lintreadme}: true
77+
py3{6,7,8,9,10}-{bandit,lint,mypy,shellcheck,pydocstyle,lintreadme}: true
7778

7879
allowlist_externals = make

0 commit comments

Comments
 (0)