1
1
import os
2
- from typing import Any
3
- from typing import Callable as tCallable
4
- from typing import Dict , Optional , Tuple , Union
2
+ from typing import Any , Dict , Optional , Union
5
3
6
4
from . import load_tool
7
5
from .context import LoadingContext , RuntimeContext
8
6
from .errors import WorkflowException
9
- from .executors import SingleJobExecutor
7
+ from .executors import JobExecutor , SingleJobExecutor
10
8
from .process import Process
9
+ from .utils import CWLObjectType
11
10
12
11
13
12
class WorkflowStatus (Exception ):
14
- def __init__ (self , out : Optional [Dict [ str , Any ] ], status : str ) -> None :
13
+ def __init__ (self , out : Optional [CWLObjectType ], status : str ) -> None :
15
14
"""Signaling exception for the status of a Workflow."""
16
15
super (WorkflowStatus , self ).__init__ ("Completed %s" % status )
17
16
self .out = out
@@ -25,7 +24,7 @@ def __init__(self, t: Process, factory: "Factory") -> None:
25
24
self .factory = factory
26
25
27
26
def __call__ (self , ** kwargs ):
28
- # type: (**Any) -> Union[str, Optional[Dict[str, Any] ]]
27
+ # type: (**Any) -> Union[str, Optional[CWLObjectType ]]
29
28
runtime_context = self .factory .runtime_context .copy ()
30
29
runtime_context .basedir = os .getcwd ()
31
30
out , status = self .factory .executor (self .t , kwargs , runtime_context )
@@ -38,7 +37,7 @@ def __call__(self, **kwargs):
38
37
class Factory (object ):
39
38
def __init__ (
40
39
self ,
41
- executor : Optional [tCallable [..., Tuple [ Optional [ Dict [ str , Any ]], str ]] ] = None ,
40
+ executor : Optional [JobExecutor ] = None ,
42
41
loading_context : Optional [LoadingContext ] = None ,
43
42
runtime_context : Optional [RuntimeContext ] = None ,
44
43
) -> None :
0 commit comments