Skip to content

Commit a366a07

Browse files
committed
type updates for mypy 1.7.x
1 parent a0e6080 commit a366a07

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

cwltool/job.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@
6666
from .cwlprov.provenance_profile import (
6767
ProvenanceProfile, # pylint: disable=unused-import
6868
)
69+
70+
CollectOutputsType = Union[
71+
Callable[[str, int], CWLObjectType], functools.partial[CWLObjectType]
72+
]
73+
6974
needs_shell_quoting_re = re.compile(r"""(^$|[\s|&;()<>\'"$@])""")
7075

7176
FORCE_SHELLED_POPEN = os.getenv("CWLTOOL_FORCE_SHELL_POPEN", "0") == "1"
@@ -112,9 +117,6 @@ def neverquote(string: str, pos: int = 0, endpos: int = 0) -> Optional[Match[str
112117
return None
113118

114119

115-
CollectOutputsType = Union[Callable[[str, int], CWLObjectType], functools.partial]
116-
117-
118120
class JobBase(HasReqsHints, metaclass=ABCMeta):
119121
def __init__(
120122
self,
@@ -144,7 +146,7 @@ def __init__(
144146
self.generatemapper: Optional[PathMapper] = None
145147

146148
# set in CommandLineTool.job(i)
147-
self.collect_outputs = cast(CollectOutputsType, None)
149+
self.collect_outputs = cast("CollectOutputsType", None)
148150
self.output_callback: Optional[OutputCallbackType] = None
149151
self.outdir = ""
150152
self.tmpdir = ""

mypy.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ show_column_numbers = true
55
show_error_codes = true
66
pretty = true
77
warn_unreachable = True
8-
new_type_inference = True
98

109
[mypy-galaxy.tool_util.*]
1110
ignore_missing_imports = True

tests/test_singularity_versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def reset_singularity_version_cache() -> None:
2121
def set_dummy_check_output(name: str, version: str) -> None:
2222
"""Mock out subprocess.check_output."""
2323
cwltool.singularity.check_output = ( # type: ignore[attr-defined]
24-
lambda c, text: name + " version " + version
24+
lambda c, text: name + " version " + version # type: ignore[assignment]
2525
)
2626

2727

0 commit comments

Comments
 (0)