Skip to content

Commit 5054961

Browse files
committed
upgrade to mypy 0.470
1 parent 8fd2300 commit 5054961

File tree

7 files changed

+21
-12
lines changed

7 files changed

+21
-12
lines changed

cwltool/factory.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@ def __call__(self, **kwargs):
3434

3535

3636
class Factory(object):
37-
def __init__(self, makeTool=workflow.defaultMakeTool,
38-
executor=main.single_job_executor,
39-
**execkwargs):
40-
# type: (tCallable[[Dict[Text, Any], Any], Process],tCallable[...,Tuple[Dict[Text,Any], Text]], **Any) -> None
37+
def __init__(self,
38+
makeTool=workflow.defaultMakeTool, # type: tCallable[[Any], Process]
39+
# should be tCallable[[Dict[Text, Any], Any], Process] ?
40+
executor=main.single_job_executor, # type: tCallable[...,Tuple[Dict[Text,Any], Text]]
41+
**execkwargs # type: Any
42+
):
43+
# type: (...) -> None
4144
self.makeTool = makeTool
4245
self.executor = executor
4346
self.execkwargs = execkwargs

cwltool/job.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ def run(self, dry_run=False, pull_image=True, rm_container=True,
206206

207207
scr, _ = get_feature(self, "ShellCommandRequirement")
208208

209+
shouldquote = None # type: Callable[[Any], Any]
209210
if scr:
210211
shouldquote = lambda x: False
211212
else:

cwltool/main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,11 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
182182
return parser
183183

184184

185-
def single_job_executor(t, job_order_object, **kwargs):
186-
# type: (Process, Dict[Text, Any], **Any) -> Tuple[Dict[Text, Any], Text]
185+
def single_job_executor(t, # type: Process
186+
job_order_object, # type: Dict[Text, Any]
187+
**kwargs # type: Any
188+
):
189+
# type: (...) -> Tuple[Dict[Text, Any], Text]
187190
final_output = []
188191
final_status = []
189192

cwltool/workflow.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
WorkflowStateItem = namedtuple('WorkflowStateItem', ['parameter', 'value'])
2323

2424

25-
def defaultMakeTool(toolpath_object, **kwargs):
26-
# type: (Dict[Text, Any], **Any) -> Process
25+
def defaultMakeTool(toolpath_object, # type: Dict[Text, Any]
26+
**kwargs # type: Any
27+
):
28+
# type: (...) -> Process
2729
if not isinstance(toolpath_object, dict):
2830
raise WorkflowException(u"Not a dict: `%s`" % toolpath_object)
2931
if "class" in toolpath_object:

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ ruamel.yaml==0.13.7
33
rdflib==4.2.1
44
rdflib-jsonld==0.4.0
55
shellescape==3.4.1
6-
schema-salad>=2.1.20161227155225,<3
6+
schema-salad>=2.1.20170208112505,<3
77
typing==3.5.2.2 ; python_version>="2.7"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
'ruamel.yaml >= 0.12.4',
4848
'rdflib >= 4.2.0, < 4.3.0',
4949
'shellescape >= 3.4.1, < 3.5',
50-
'schema-salad >= 2.2.20170111180227, < 3',
50+
'schema-salad >= 2.2.20170208112505, < 3',
5151
'typing >= 3.5.2, < 3.6'
5252
],
5353
test_suite='tests',

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
#envlist = py35-lint,py34-lint,py33-lint,py27-lint,py35-unit,py34-unit,py33-unit,py27-unit
3-
envlist = py27-lint, py27-unit, pip27-pipconflictchecker, py35-mypy
3+
envlist = py27-lint, py27-unit, py27-pipconflictchecker, py35-mypy
44
skipsdist = True
55

66
[tox:travis]
@@ -14,7 +14,7 @@ deps = -rrequirements.txt
1414
commands = make mypy
1515
whitelist_externals = make
1616
deps =
17-
mypy-lang>=0.4.4
17+
mypy>=0.470
1818
typed-ast
1919
-rrequirements.txt
2020

0 commit comments

Comments
 (0)