Skip to content

Commit

Permalink
Update mypy version (onnx#968)
Browse files Browse the repository at this point in the history
  • Loading branch information
smessmer authored May 17, 2018
1 parent ba86ec2 commit 94ca052
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/Operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ test_cases = {
[[5, 6], [7, 8]]),
'3d': ([[[1, 2], [3, 4]], [[5, 6], [7, 8]]],
[[[9, 10], [11, 12]], [[13, 14], [15, 16]]])
}
} # type: Dict[Text, Sequence[Any]]

for test_case, values_ in test_cases.items():
values = [np.asarray(v, dtype=np.float32) for v in values_]
Expand Down
2 changes: 1 addition & 1 deletion onnx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _deserialize(s, proto): # type: (bytes, _Proto) -> _Proto
raise ValueError('No ParseFromString method is detected. '
'\ntype is {}'.format(type(proto)))

decoded = proto.ParseFromString(s) # type: ignore
decoded = cast(Optional[int], proto.ParseFromString(s))
if decoded is not None and decoded != len(s):
raise google.protobuf.message.DecodeError(
"Protobuf decoding consumed too few bytes: {} out of {}".format(
Expand Down
3 changes: 2 additions & 1 deletion onnx/backend/test/case/node/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import onnx
from ..base import Base
from . import expect
from typing import Dict, Sequence, Text, Any


class Concat(Base):
Expand All @@ -21,7 +22,7 @@ def export(): # type: () -> None
[[5, 6], [7, 8]]),
'3d': ([[[1, 2], [3, 4]], [[5, 6], [7, 8]]],
[[[9, 10], [11, 12]], [[13, 14], [15, 16]]])
}
} # type: Dict[Text, Sequence[Any]]

for test_case, values_ in test_cases.items():
values = [np.asarray(v, dtype=np.float32) for v in values_]
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/runner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def test_suite(self): # type: () -> unittest.TestSuite
'''
suite = unittest.TestSuite()
for case in sorted(self.test_cases.values()):
suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(case)) # type: ignore
suite.addTests(unittest.defaultTestLoader.loadTestsFromTestCase(case))
return suite

# For backward compatibility (we used to expose `.tests`)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def build_extensions(self):

if sys.version_info[0] == 3:
# Mypy doesn't work with Python 2
extras_require['mypy'] = ['mypy==0.570']
extras_require['mypy'] = ['mypy==0.600']

################################################################################
# Final
Expand Down

0 comments on commit 94ca052

Please sign in to comment.