Skip to content

Bump mypy from 1.10.1 to 1.11.1 #2028

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

Merged
merged 2 commits into from
Jul 31, 2024
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
2 changes: 1 addition & 1 deletion cwltool/command_line_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ def remove_dirname(d: CWLObjectType) -> None:
def job(
self,
job_order: CWLObjectType,
output_callbacks: Optional[OutputCallbackType],
output_callbacks: OutputCallbackType,
runtimeContext: RuntimeContext,
) -> Generator[Union[JobBase, CallbackJob], None, None]:
workReuse, _ = self.get_requirement("WorkReuse")
Expand Down
2 changes: 1 addition & 1 deletion cwltool/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ def visit(self, op: Callable[[CommentedMap], None]) -> None:
def job(
self,
job_order: CWLObjectType,
output_callbacks: Optional[OutputCallbackType],
output_callbacks: OutputCallbackType,
runtimeContext: RuntimeContext,
) -> JobsGeneratorType:
pass
Expand Down
6 changes: 3 additions & 3 deletions cwltool/procgenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def receive_output(self, jobout: Optional[CWLObjectType], processStatus: str) ->
def job(
self,
job_order: CWLObjectType,
output_callbacks: Optional[OutputCallbackType],
output_callbacks: OutputCallbackType,
runtimeContext: RuntimeContext,
) -> JobsGeneratorType:
try:
Expand All @@ -41,7 +41,7 @@ def job(
while self.processStatus is None:
yield None

if self.processStatus != "success" and output_callbacks:
if self.processStatus != "success":
output_callbacks(self.jobout, self.processStatus)
return

Expand Down Expand Up @@ -89,7 +89,7 @@ def __init__(
def job(
self,
job_order: CWLObjectType,
output_callbacks: Optional[OutputCallbackType],
output_callbacks: OutputCallbackType,
runtimeContext: RuntimeContext,
) -> JobsGeneratorType:
return ProcessGeneratorJob(self).job(job_order, output_callbacks, runtimeContext)
Expand Down
4 changes: 2 additions & 2 deletions cwltool/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def make_workflow_step(
def job(
self,
job_order: CWLObjectType,
output_callbacks: Optional[OutputCallbackType],
output_callbacks: OutputCallbackType,
runtimeContext: RuntimeContext,
) -> JobsGeneratorType:
builder = self._init_job(job_order, runtimeContext)
Expand Down Expand Up @@ -420,7 +420,7 @@ def receive_output(
def job(
self,
job_order: CWLObjectType,
output_callbacks: Optional[OutputCallbackType],
output_callbacks: OutputCallbackType,
runtimeContext: RuntimeContext,
) -> JobsGeneratorType:
"""Initialize sub-workflow as a step in the parent profile."""
Expand Down
8 changes: 4 additions & 4 deletions cwltool/workflow_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(self, step: "WorkflowStep") -> None:
def job(
self,
joborder: CWLObjectType,
output_callback: Optional[OutputCallbackType],
output_callback: OutputCallbackType,
runtimeContext: RuntimeContext,
) -> JobsGeneratorType:
runtimeContext = runtimeContext.copy()
Expand Down Expand Up @@ -584,7 +584,7 @@ def receive_output(
def try_make_job(
self,
step: WorkflowJobStep,
final_output_callback: Optional[OutputCallbackType],
final_output_callback: OutputCallbackType,
runtimeContext: RuntimeContext,
) -> JobsGeneratorType:
container_engine = "docker"
Expand Down Expand Up @@ -773,7 +773,7 @@ def run(
def job(
self,
joborder: CWLObjectType,
output_callback: Optional[OutputCallbackType],
output_callback: OutputCallbackType,
runtimeContext: RuntimeContext,
) -> JobsGeneratorType:
self.state = {}
Expand Down Expand Up @@ -848,7 +848,7 @@ def job(
else:
yield None

if not self.did_callback and output_callback:
if not self.did_callback:
# could have called earlier on line 336;
self.do_output_callback(output_callback)
# depends which one comes first. All steps are completed
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.10.1 # also update pyproject.toml
mypy==1.11.1 # also update pyproject.toml
ruamel.yaml>=0.16.0,<0.19
cwl-utils>=0.32
types-requests
Expand Down
4 changes: 2 additions & 2 deletions tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def test_replace_default_stdout_stderr() -> None:
original_stdout = sys.stdout
original_stderr = sys.stderr

sys.stdout = "" # type: ignore
sys.stderr = "" # type: ignore
sys.stdout = ""
sys.stderr = ""

runtime_context = RuntimeContext()
runtime_context.default_stdout = subprocess.DEVNULL # type: ignore
Expand Down
4 changes: 2 additions & 2 deletions tests/test_load_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ def test_check_version() -> None:
joborder: CWLObjectType = {"inp": "abc"}
loadingContext = LoadingContext({"do_update": True})
tool = load_tool(get_data("tests/echo.cwl"), loadingContext)
for _ in tool.job(joborder, None, RuntimeContext()):
for _ in tool.job(joborder, lambda output, process_status: None, RuntimeContext()):
pass

loadingContext = LoadingContext({"do_update": False})
tool = load_tool(get_data("tests/echo.cwl"), loadingContext)
with pytest.raises(WorkflowException):
for _ in tool.job(joborder, None, RuntimeContext()):
for _ in tool.job(joborder, lambda output, process_status: None, RuntimeContext()):
pass


Expand Down
4 changes: 2 additions & 2 deletions tests/test_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_regular_file() -> None:
}
}

job = next(clt.job(joborder, None, runtime_context))
job = next(clt.job(joborder, lambda output, process_status: None, runtime_context))
assert isinstance(job, JobBase)

job._setup(runtime_context)
Expand Down Expand Up @@ -99,7 +99,7 @@ def test_input_can_be_named_pipe(
}
}

job = next(clt.job(joborder, None, runtime_context))
job = next(clt.job(joborder, lambda output, process_status: None, runtime_context))
assert isinstance(job, JobBase)

if raise_exception:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_tmpdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_docker_commandLineTool_job_tmpdir_prefix(tmp_path: Path) -> None:
"tmp_outdir_prefix": tmp_outdir_prefix,
}
)
job = next(clt.job({}, None, runtime_context))
job = next(clt.job({}, lambda output, process_status: None, runtime_context))
assert isinstance(job, JobBase)
assert job.stagedir and job.stagedir.startswith(tmpdir_prefix)
assert job.tmpdir and job.tmpdir.startswith(tmpdir_prefix)
Expand Down Expand Up @@ -106,7 +106,7 @@ def test_commandLineTool_job_tmpdir_prefix(tmp_path: Path) -> None:
"tmp_outdir_prefix": tmp_outdir_prefix,
}
)
job = next(clt.job({}, None, runtime_context))
job = next(clt.job({}, lambda output, process_status: None, runtime_context))
assert isinstance(job, JobBase)
assert job.stagedir and job.stagedir.startswith(tmpdir_prefix)
assert job.tmpdir and job.tmpdir.startswith(tmpdir_prefix)
Expand Down