diff --git a/cwltool/command_line_tool.py b/cwltool/command_line_tool.py index ec478fafe..d98648769 100644 --- a/cwltool/command_line_tool.py +++ b/cwltool/command_line_tool.py @@ -16,7 +16,7 @@ from enum import Enum from functools import cmp_to_key, partial from re import Pattern -from typing import TYPE_CHECKING, Any, Optional, TextIO, Union, cast +from typing import TYPE_CHECKING, Any, Iterable, Optional, TextIO, Union, cast from mypy_extensions import mypyc_attr from ruamel.yaml.comments import CommentedMap, CommentedSeq @@ -1322,26 +1322,29 @@ def collect_output( key=cmp_to_key(locale.strcoll), ) r.extend( - [ - { - "location": g, - "path": fs_access.join( - builder.outdir, - urllib.parse.unquote(g[len(prefix[0]) + 1 :]), - ), - "basename": decoded_basename, - "nameroot": os.path.splitext(decoded_basename)[0], - "nameext": os.path.splitext(decoded_basename)[1], - "class": "File" if fs_access.isfile(g) else "Directory", - } - for g, decoded_basename in zip( - sorted_glob_result, - map( - lambda x: os.path.basename(urllib.parse.unquote(x)), + cast( + Iterable[CWLOutputType], + [ + { + "location": g, + "path": fs_access.join( + builder.outdir, + urllib.parse.unquote(g[len(prefix[0]) + 1 :]), + ), + "basename": decoded_basename, + "nameroot": os.path.splitext(decoded_basename)[0], + "nameext": os.path.splitext(decoded_basename)[1], + "class": "File" if fs_access.isfile(g) else "Directory", + } + for g, decoded_basename in zip( sorted_glob_result, - ), - ) - ] + map( + lambda x: os.path.basename(urllib.parse.unquote(x)), + sorted_glob_result, + ), + ) + ], + ) ) except OSError as e: _logger.warning(str(e), exc_info=builder.debug) diff --git a/mypy-requirements.txt b/mypy-requirements.txt index 3523889d6..9d8546a5f 100644 --- a/mypy-requirements.txt +++ b/mypy-requirements.txt @@ -1,4 +1,4 @@ -mypy==1.16.1 # also update pyproject.toml +mypy==1.17.0 # also update pyproject.toml ruamel.yaml>=0.16.0,<0.19 cwl-utils>=0.32 cwltest diff --git a/pyproject.toml b/pyproject.toml index b5c4648c3..75d4b91c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "setuptools>=45", "setuptools_scm[toml]>=8.0.4,<9", - "mypy==1.16.1", # also update mypy-requirements.txt + "mypy==1.17.0", # also update mypy-requirements.txt "types-requests", "types-psutil", "ruamel.yaml>=0.16.0,<0.19",