Skip to content

Commit ad084c8

Browse files
authored
Merge branch 'main' into on-error-abort
2 parents a1195ad + 67df61c commit ad084c8

11 files changed

+21
-21
lines changed

cwltool/command_line_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ def remove_dirname(d: CWLObjectType) -> None:
806806
def job(
807807
self,
808808
job_order: CWLObjectType,
809-
output_callbacks: Optional[OutputCallbackType],
809+
output_callbacks: OutputCallbackType,
810810
runtimeContext: RuntimeContext,
811811
) -> Generator[Union[JobBase, CallbackJob], None, None]:
812812
workReuse, _ = self.get_requirement("WorkReuse")

cwltool/process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ def visit(self, op: Callable[[CommentedMap], None]) -> None:
10751075
def job(
10761076
self,
10771077
job_order: CWLObjectType,
1078-
output_callbacks: Optional[OutputCallbackType],
1078+
output_callbacks: OutputCallbackType,
10791079
runtimeContext: RuntimeContext,
10801080
) -> JobsGeneratorType:
10811081
pass

cwltool/procgenerator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def receive_output(self, jobout: Optional[CWLObjectType], processStatus: str) ->
3030
def job(
3131
self,
3232
job_order: CWLObjectType,
33-
output_callbacks: Optional[OutputCallbackType],
33+
output_callbacks: OutputCallbackType,
3434
runtimeContext: RuntimeContext,
3535
) -> JobsGeneratorType:
3636
try:
@@ -41,7 +41,7 @@ def job(
4141
while self.processStatus is None:
4242
yield None
4343

44-
if self.processStatus != "success" and output_callbacks:
44+
if self.processStatus != "success":
4545
output_callbacks(self.jobout, self.processStatus)
4646
return
4747

@@ -89,7 +89,7 @@ def __init__(
8989
def job(
9090
self,
9191
job_order: CWLObjectType,
92-
output_callbacks: Optional[OutputCallbackType],
92+
output_callbacks: OutputCallbackType,
9393
runtimeContext: RuntimeContext,
9494
) -> JobsGeneratorType:
9595
return ProcessGeneratorJob(self).job(job_order, output_callbacks, runtimeContext)

cwltool/workflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def make_workflow_step(
153153
def job(
154154
self,
155155
job_order: CWLObjectType,
156-
output_callbacks: Optional[OutputCallbackType],
156+
output_callbacks: OutputCallbackType,
157157
runtimeContext: RuntimeContext,
158158
) -> JobsGeneratorType:
159159
builder = self._init_job(job_order, runtimeContext)
@@ -421,7 +421,7 @@ def receive_output(
421421
def job(
422422
self,
423423
job_order: CWLObjectType,
424-
output_callbacks: Optional[OutputCallbackType],
424+
output_callbacks: OutputCallbackType,
425425
runtimeContext: RuntimeContext,
426426
) -> JobsGeneratorType:
427427
"""Initialize sub-workflow as a step in the parent profile."""

cwltool/workflow_job.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def __init__(self, step: "WorkflowStep") -> None:
6565
def job(
6666
self,
6767
joborder: CWLObjectType,
68-
output_callback: Optional[OutputCallbackType],
68+
output_callback: OutputCallbackType,
6969
runtimeContext: RuntimeContext,
7070
) -> JobsGeneratorType:
7171
runtimeContext = runtimeContext.copy()
@@ -585,7 +585,7 @@ def receive_output(
585585
def try_make_job(
586586
self,
587587
step: WorkflowJobStep,
588-
final_output_callback: Optional[OutputCallbackType],
588+
final_output_callback: OutputCallbackType,
589589
runtimeContext: RuntimeContext,
590590
) -> JobsGeneratorType:
591591
container_engine = "docker"
@@ -774,7 +774,7 @@ def run(
774774
def job(
775775
self,
776776
joborder: CWLObjectType,
777-
output_callback: Optional[OutputCallbackType],
777+
output_callback: OutputCallbackType,
778778
runtimeContext: RuntimeContext,
779779
) -> JobsGeneratorType:
780780
self.state = {}
@@ -849,7 +849,7 @@ def job(
849849
else:
850850
yield None
851851

852-
if not self.did_callback and output_callback:
852+
if not self.did_callback:
853853
# could have called earlier on line 336;
854854
self.do_output_callback(output_callback)
855855
# depends which one comes first. All steps are completed

lint-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
flake8-bugbear<24.3
2-
black~=24.4
2+
black~=24.8
33
codespell

mypy-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
mypy==1.10.1 # also update pyproject.toml
1+
mypy==1.11.1 # also update pyproject.toml
22
ruamel.yaml>=0.16.0,<0.19
33
cwl-utils>=0.32
44
types-requests

tests/test_context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def test_replace_default_stdout_stderr() -> None:
1414
original_stdout = sys.stdout
1515
original_stderr = sys.stderr
1616

17-
sys.stdout = "" # type: ignore
18-
sys.stderr = "" # type: ignore
17+
sys.stdout = ""
18+
sys.stderr = ""
1919

2020
runtime_context = RuntimeContext()
2121
runtime_context.default_stdout = subprocess.DEVNULL # type: ignore

tests/test_load_tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ def test_check_version() -> None:
3030
joborder: CWLObjectType = {"inp": "abc"}
3131
loadingContext = LoadingContext({"do_update": True})
3232
tool = load_tool(get_data("tests/echo.cwl"), loadingContext)
33-
for _ in tool.job(joborder, None, RuntimeContext()):
33+
for _ in tool.job(joborder, lambda output, process_status: None, RuntimeContext()):
3434
pass
3535

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

4242

tests/test_streaming.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test_regular_file() -> None:
6161
}
6262
}
6363

64-
job = next(clt.job(joborder, None, runtime_context))
64+
job = next(clt.job(joborder, lambda output, process_status: None, runtime_context))
6565
assert isinstance(job, JobBase)
6666

6767
job._setup(runtime_context)
@@ -99,7 +99,7 @@ def test_input_can_be_named_pipe(
9999
}
100100
}
101101

102-
job = next(clt.job(joborder, None, runtime_context))
102+
job = next(clt.job(joborder, lambda output, process_status: None, runtime_context))
103103
assert isinstance(job, JobBase)
104104

105105
if raise_exception:

0 commit comments

Comments
 (0)