Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump mypy from 1.6.1 to 1.7.1 #1940

Merged
merged 2 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions cwltool/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
from .cwlprov.provenance_profile import (
ProvenanceProfile, # pylint: disable=unused-import
)

CollectOutputsType = Union[
Callable[[str, int], CWLObjectType], functools.partial[CWLObjectType]
]

needs_shell_quoting_re = re.compile(r"""(^$|[\s|&;()<>\'"$@])""")

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


CollectOutputsType = Union[Callable[[str, int], CWLObjectType], functools.partial]


class JobBase(HasReqsHints, metaclass=ABCMeta):
def __init__(
self,
Expand Down Expand Up @@ -144,7 +146,7 @@ def __init__(
self.generatemapper: Optional[PathMapper] = None

# set in CommandLineTool.job(i)
self.collect_outputs = cast(CollectOutputsType, None)
self.collect_outputs = cast("CollectOutputsType", None)
self.output_callback: Optional[OutputCallbackType] = None
self.outdir = ""
self.tmpdir = ""
Expand Down
2 changes: 1 addition & 1 deletion mypy-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mypy==1.6.1 # also update pyproject.toml
mypy==1.7.1 # also update pyproject.toml
ruamel.yaml>=0.16.0,<0.19
cwl-utils>=0.22,!=0.30
types-requests
Expand Down
1 change: 0 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ show_column_numbers = true
show_error_codes = true
pretty = true
warn_unreachable = True
new_type_inference = True

[mypy-galaxy.tool_util.*]
ignore_missing_imports = True
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
requires = [
"setuptools>=45",
"setuptools_scm[toml]>=8.0.4,<9",
"mypy==1.6.0", # also update mypy-requirements.txt
"mypy==1.7.1", # also update mypy-requirements.txt
"types-requests",
"types-psutil",
"importlib_resources>=1.4", # equivalent to Python 3.9
Expand Down
2 changes: 1 addition & 1 deletion tests/test_singularity_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def reset_singularity_version_cache() -> None:
def set_dummy_check_output(name: str, version: str) -> None:
"""Mock out subprocess.check_output."""
cwltool.singularity.check_output = ( # type: ignore[attr-defined]
lambda c, text: name + " version " + version
lambda c, text: name + " version " + version # type: ignore[assignment]
)


Expand Down