Skip to content

Commit 9398f32

Browse files
committed
Revert "add back in Python 3.7 for one last release"
This reverts commit 6c32ae5.
1 parent 2e095e1 commit 9398f32

File tree

13 files changed

+28
-59
lines changed

13 files changed

+28
-59
lines changed

.github/workflows/ci-tests.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,8 @@ jobs:
3232
strategy:
3333
matrix:
3434
py-ver-major: [3]
35-
py-ver-minor: [7, 8, 9, 10, 11, 12]
35+
py-ver-minor: [8, 9, 10, 11, 12]
3636
step: [lint, unit, bandit, mypy]
37-
exclude:
38-
- py-ver-major: 3
39-
py-ver-minor: 7
40-
step: mypy
41-
- py-ver-major: 3
42-
py-ver-minor: 7
43-
step: lint
44-
- py-ver-major: 3
45-
py-ver-minor: 7
46-
step: bandit
4737

4838
env:
4939
py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }}

cwltool/checker.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
Dict,
66
Iterator,
77
List,
8+
Literal,
89
MutableMapping,
910
MutableSequence,
1011
Optional,
1112
Sized,
1213
Union,
1314
cast,
1415
)
15-
from typing_extensions import Literal
1616

1717
from schema_salad.exceptions import ValidationException
1818
from schema_salad.sourceline import SourceLine, bullets, strip_dup_lineno
@@ -509,8 +509,7 @@ def get_step_id(field_id: str) -> str:
509509

510510

511511
def is_conditional_step(param_to_step: Dict[str, CWLObjectType], parm_id: str) -> bool:
512-
source_step = param_to_step.get(parm_id)
513-
if source_step is not None:
512+
if (source_step := param_to_step.get(parm_id)) is not None:
514513
if source_step.get("when") is not None:
515514
return True
516515
return False

cwltool/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
Dict,
1313
Iterable,
1414
List,
15+
Literal,
1516
Optional,
1617
TextIO,
1718
Tuple,
1819
Union,
1920
)
20-
from typing_extensions import Literal
2121

2222
from ruamel.yaml.comments import CommentedMap
2323
from schema_salad.avro.schema import Names

cwltool/cwlprov/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
import re
77
import uuid
88
from getpass import getuser
9-
from typing import IO, Any, Callable, Dict, List, Optional, Tuple, Union
10-
from typing_extensions import TypedDict
9+
from typing import IO, Any, Callable, Dict, List, Optional, Tuple, TypedDict, Union
1110

1211

1312
def _whoami() -> Tuple[str, str]:

cwltool/docker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ def get_image(
113113
if docker_requirement["dockerImageId"] in _IMAGES:
114114
return True
115115

116-
docker_image_id = docker_requirement.get("dockerImageId")
117-
if docker_image_id is not None:
116+
if (docker_image_id := docker_requirement.get("dockerImageId")) is not None:
118117
try:
119118
manifest = json.loads(
120119
subprocess.check_output(

cwltool/software_requirements.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,8 @@ def build_job_script(self, builder: "Builder", command: List[str]) -> str:
9191
resolution_config_dict=resolution_config_dict,
9292
conf_file=self.dependency_resolvers_config_file,
9393
)
94-
dependencies = get_dependencies(builder)
95-
handle_dependencies = "" # str
96-
if dependencies:
94+
handle_dependencies: str = ""
95+
if dependencies := get_dependencies(builder):
9796
handle_dependencies = "\n".join(
9897
tool_dependency_manager.dependency_shell_commands(
9998
dependencies, job_directory=builder.tmpdir

cwltool/utils.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Shared functions and other definitions."""
22
import collections
33
import fcntl
4+
import importlib.metadata
45
import os
56
import random
67
import shutil
@@ -27,16 +28,17 @@
2728
Generator,
2829
Iterable,
2930
List,
31+
Literal,
3032
MutableMapping,
3133
MutableSequence,
3234
NamedTuple,
3335
Optional,
3436
Set,
3537
Tuple,
38+
TypedDict,
3639
Union,
3740
cast,
3841
)
39-
from typing_extensions import Literal, TypedDict
4042

4143
import requests
4244
from cachecontrol import CacheControl
@@ -45,11 +47,6 @@
4547
from schema_salad.exceptions import ValidationException
4648
from schema_salad.ref_resolver import Loader
4749

48-
if sys.version_info >= (3, 8):
49-
import importlib.metadata as importlib_metadata
50-
else:
51-
import importlib_metadata
52-
5350
if TYPE_CHECKING:
5451
from .command_line_tool import CallbackJob, ExpressionJob
5552
from .job import CommandLineJob, JobBase
@@ -120,8 +117,7 @@ class WorkflowStateItem(NamedTuple):
120117

121118
def versionstring() -> str:
122119
"""Version of CWLtool used to execute the workflow."""
123-
pkg = importlib_metadata.version("cwltool")
124-
if pkg:
120+
if pkg := importlib.metadata.version("cwltool"):
125121
return f"{sys.argv[0]} {pkg}"
126122
return "{} {}".format(sys.argv[0], "unknown version")
127123

docs/conf.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import sys
1515
from datetime import datetime
1616
import time
17+
import importlib.metadata
1718

1819
sys.path.insert(0, os.path.abspath(".."))
1920

@@ -81,12 +82,7 @@
8182
# so a file named "default.css" will overwrite the builtin "default.css".
8283
html_static_path = ["_static"]
8384

84-
85-
if sys.version_info >= (3, 8):
86-
import importlib.metadata as importlib_metadata
87-
else:
88-
import importlib_metadata
89-
release = importlib_metadata.version("cwltool")
85+
release = importlib.metadata.version("cwltool")
9086
version = ".".join(release.split(".")[:2])
9187

9288
autoapi_dirs = ["../cwltool"]

gittaggers.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22
import sys
33
import time
44

5-
if sys.version_info >= (3, 8):
6-
import importlib.metadata as importlib_metadata
7-
else:
8-
import importlib_metadata
5+
import importlib.metadata
96

107
from typing import Any
118

129
from setuptools.command.egg_info import egg_info
1310

14-
SETUPTOOLS_VER = importlib_metadata.version("setuptools").split(".")
11+
SETUPTOOLS_VER = importlib.metadata.version("setuptools").split(".")
1512

1613
RECENT_SETUPTOOLS = (
1714
int(SETUPTOOLS_VER[0]) > 40

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ build-backend = "setuptools.build_meta"
1515

1616
[tool.black]
1717
line-length = 100
18-
target-version = [ "py37" ]
18+
target-version = [ "py38" ]

0 commit comments

Comments
 (0)