Skip to content

Commit

Permalink
Revert "[Typing 1/3] Setup mypy type checker (onnx#607)" (onnx#667)
Browse files Browse the repository at this point in the history
This reverts commit 086727e.
  • Loading branch information
bddppq authored Mar 27, 2018
1 parent 086727e commit 9d2b530
Show file tree
Hide file tree
Showing 82 changed files with 85 additions and 157 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*.pb.cc
*_pb2.py
*_pb.py
*_pb2.pyi
*_pb.pyi

# Compiled python
*.pyc
Expand Down Expand Up @@ -86,6 +84,3 @@ onnx/examples/.coverage.nbval

# autocomplete
.ycm_extra_conf.py

.mypy_cache
virtualenv
11 changes: 0 additions & 11 deletions .travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,3 @@ git diff --exit-code
# lint python code
pip install flake8
flake8

# Mypy only works with Python 3
if [ "${PYTHON_VERSION}" != "python2" ]; then
# Mypy only works with our generated _pb.py files when we install in develop mode, so let's do that
time ONNX_NAMESPACE=ONNX_NAMESPACE_FOO_BAR_FOR_CI pip install -e .[mypy]

time mypy .
# Also test in python2 mode (but this is still in the python 3 CI
# instance, because mypy itself needs python 3)
time mypy --py2 .
fi
2 changes: 1 addition & 1 deletion onnx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import onnx.checker # noqa
import onnx.defs # noqa

import google.protobuf.message # type: ignore
import google.protobuf.message


def load(obj):
Expand Down
7 changes: 3 additions & 4 deletions onnx/backend/test/case/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
from collections import defaultdict
import inspect
from textwrap import dedent
from typing import Dict, Text, List, Tuple

import numpy as np # type: ignore
import numpy as np
from six import add_metaclass


Expand All @@ -22,11 +21,11 @@ def process_snippet(op_name, name, export):
return snippet_name, dedent("\n".join(lines[2:]))


Snippets = defaultdict(list) # type: Dict[Text, List[Tuple[Text, Text]]]
Snippets = defaultdict(list)


class _Exporter(type):
exports = defaultdict(list) # type: Dict[Text, List[Tuple[Text, Text]]]
exports = defaultdict(list)

def __init__(cls, name, bases, dct):
for k, v in dct.items():
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/model/single-relu.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/abs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/and.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/averagepool.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from onnx import TensorProto
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/ceil.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/depthtospace.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/div.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/elu.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/equal.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/flatten.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/floor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/gather.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/globalaveragepool.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/globalmaxpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/greater.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/hardmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/hardsigmoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/leakyrelu.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/less.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/logsoftmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/matmul.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/max.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/maxpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/mean.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/min.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/mul.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/neg.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/not.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
2 changes: 1 addition & 1 deletion onnx/backend/test/case/node/or.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import print_function
from __future__ import unicode_literals

import numpy as np # type: ignore
import numpy as np

import onnx
from ..base import Base
Expand Down
Loading

0 comments on commit 9d2b530

Please sign in to comment.