Skip to content

Commit d029e07

Browse files
committed
freshen cwltool/context.py
1 parent a0f4cc1 commit d029e07

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

cwltool/context.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Shared context objects that replace use of kwargs."""
22
import copy
33
import threading
4-
from typing import Any, Callable, Dict, Iterable, List, MutableMapping, Optional
4+
from typing import Any, Callable, Dict, Iterable, List, Optional, Union
55

66
# move to a regular typing import when Python 3.3-3.6 is no longer supported
77
from ruamel.yaml.comments import CommentedMap
@@ -19,9 +19,7 @@
1919

2020
if TYPE_CHECKING:
2121
from .process import Process
22-
from .provenance import (
23-
ResearchObject, # pylint: disable=unused-import
24-
)
22+
from .provenance import ResearchObject # pylint: disable=unused-import
2523
from .provenance_profile import ProvenanceProfile
2624

2725

@@ -47,10 +45,10 @@ class LoadingContext(ContextBase):
4745
def __init__(self, kwargs: Optional[Dict[str, Any]] = None) -> None:
4846
"""Initialize the LoadingContext from the kwargs."""
4947
self.debug = False # type: bool
50-
self.metadata = {} # type: Dict[str, Any]
48+
self.metadata = {} # type: CWLObjectType
5149
self.requirements = None # type: Optional[List[CWLObjectType]]
5250
self.hints = None # type: Optional[List[CWLObjectType]]
53-
self.overrides_list = [] # type: List[Dict[str, Any]]
51+
self.overrides_list = [] # type: List[CWLObjectType]
5452
self.loader = None # type: Optional[Loader]
5553
self.avsc_names = None # type: Optional[Names]
5654
self.disable_js_validation = False # type: bool
@@ -82,7 +80,7 @@ class RuntimeContext(ContextBase):
8280
def __init__(self, kwargs: Optional[Dict[str, Any]] = None) -> None:
8381
"""Initializet the RuntimeContext from the kwargs."""
8482
select_resources_callable = Callable[ # pylint: disable=unused-variable
85-
[Dict[str, int], RuntimeContext], Dict[str, int]
83+
[Dict[str, Union[int, float]], RuntimeContext], Dict[str, Union[int, float]]
8684
]
8785
self.user_space_docker_cmd = "" # type: Optional[str]
8886
self.secret_store = None # type: Optional[SecretStore]
@@ -130,7 +128,7 @@ def __init__(self, kwargs: Optional[Dict[str, Any]] = None) -> None:
130128
self.eval_timeout = 20 # type: float
131129
self.postScatterEval = (
132130
None
133-
) # type: Optional[Callable[[MutableMapping[str, Any]], Optional[MutableMapping[str, Any]]]]
131+
) # type: Optional[Callable[[CWLObjectType], Optional[CWLObjectType]]]
134132
self.on_error = "stop" # type: str
135133
self.strict_memory_limit = False # type: bool
136134

0 commit comments

Comments
 (0)