Skip to content

Commit 8056a64

Browse files
authored
mypy0.620 (#858)
1 parent 913fc68 commit 8056a64

File tree

5 files changed

+5
-100
lines changed

5 files changed

+5
-100
lines changed

cwltool/command_line_tool.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -761,9 +761,7 @@ def collect_output(self,
761761
primary["format"] = builder.do_eval(schema["format"], context=primary)
762762

763763
# Ensure files point to local references outside of the run environment
764-
adjustFileObjs(r, cast( # known bug in mypy
765-
# https://github.com/python/mypy/issues/797
766-
Callable[[Any], Any], revmap))
764+
adjustFileObjs(r, revmap)
767765

768766
if not r and optional:
769767
return None

cwltool/provenance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
if six.PY2:
6767
class PermissionError(OSError):
68-
"to avoid mypy3 error"
68+
"Needed for Python2."
6969
pass
7070
__citation__ = "https://doi.org/10.5281/zenodo.1208477"
7171

cwltool/stdfsaccess.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import glob
44
import os
55
from io import open
6-
from typing import (IO, BinaryIO, List, # pylint: disable=unused-import
6+
from typing import (Any, IO, BinaryIO, List, # pylint: disable=unused-import
77
Text, Union, overload)
88

99
import six
@@ -35,17 +35,7 @@ def _abs(self, p): # type: (Text) -> Text
3535
def glob(self, pattern): # type: (Text) -> List[Text]
3636
return [file_uri(str(self._abs(l))) for l in glob.glob(self._abs(pattern))]
3737

38-
# overload is related to mypy type checking and in no way
39-
# modifies the behaviour of the function.
40-
@overload
41-
def open(self, fn, mode='rb'): # type: (Text, str) -> IO[bytes]
42-
pass
43-
44-
@overload
45-
def open(self, fn, mode='r'): # type: (Text, str) -> IO[str]
46-
pass
47-
48-
def open(self, fn, mode):
38+
def open(self, fn, mode): # type: (Text, str) -> IO[Any]
4939
return open(self._abs(fn), mode)
5040

5141
def exists(self, fn): # type: (Text) -> bool

tox.ini

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ python =
2222
passenv = CI TRAVIS TRAVIS_*
2323
deps =
2424
-rrequirements.txt
25+
py35-mypy{2,3}: mypy==0.620
2526
py{27,34,35,36,37}-unit: codecov
2627
py{27,34,35,36,37}-unit: pytest-xdist
2728
py{27,34,35,36,37}-unit: pytest-cov
@@ -44,16 +45,10 @@ whitelist_externals =
4445
[testenv:py35-mypy2]
4546
commands = make mypy2
4647
whitelist_externals = make
47-
deps =
48-
mypy==0.610
49-
-rrequirements.txt
5048

5149
[testenv:py35-mypy3]
5250
commands = make mypy3
5351
whitelist_externals = make
54-
deps =
55-
mypy==0.610
56-
-rrequirements.txt
5752

5853
[testenv:py27-pipconflictchecker]
5954
commands = pipconflictchecker

typeshed/2.7/urlparse.pyi

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)