From 58f5e729b6b6ed7269500053d192c3c8b7b2aa33 Mon Sep 17 00:00:00 2001 From: Raghav Jajodia Date: Fri, 3 Mar 2017 23:31:52 +0530 Subject: [PATCH] mypy: Added Dict, List and Set imports. Fixed mypy errors associated with the upgrade. --- bots/irc-mirror.py | 2 +- bots/jabber_mirror_backend.py | 2 +- bots/log2zulip | 1 + bots/zephyr_mirror_backend.py | 2 +- integrations/openshift/post_deploy | 1 + integrations/openshift/zulip_openshift_config.py | 2 +- integrations/trac/zulip_trac.py | 2 +- setup.py | 2 +- zulip/__init__.py | 2 +- 9 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bots/irc-mirror.py b/bots/irc-mirror.py index 0a9e3f2..16c2621 100755 --- a/bots/irc-mirror.py +++ b/bots/irc-mirror.py @@ -14,7 +14,7 @@ import zulip import optparse if False: - from typing import Any + from typing import Any, Dict IRC_DOMAIN = "irc.example.com" diff --git a/bots/jabber_mirror_backend.py b/bots/jabber_mirror_backend.py index e579e7a..e78998c 100755 --- a/bots/jabber_mirror_backend.py +++ b/bots/jabber_mirror_backend.py @@ -37,7 +37,7 @@ # | other sender| x | | | # public mode +-------------+-----+----+--------+---- # | self sender | | | | -from typing import Set +from typing import Dict, List, Set import logging import threading diff --git a/bots/log2zulip b/bots/log2zulip index 839581b..060fcfa 100755 --- a/bots/log2zulip +++ b/bots/log2zulip @@ -22,6 +22,7 @@ import ujson sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../api")) import zulip +from typing import List lock_path = "/var/tmp/log2zulip.lock" control_path = "/etc/log2zulip.conf" diff --git a/bots/zephyr_mirror_backend.py b/bots/zephyr_mirror_backend.py index 6ee08b2..f3b747f 100755 --- a/bots/zephyr_mirror_backend.py +++ b/bots/zephyr_mirror_backend.py @@ -21,7 +21,7 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. from __future__ import absolute_import -from typing import IO, Any, Text, Union, Set, Tuple +from typing import IO, Any, Dict, List, Text, Union, Set, Tuple from types import FrameType import sys diff --git a/integrations/openshift/post_deploy b/integrations/openshift/post_deploy index 778745d..3333e62 100755 --- a/integrations/openshift/post_deploy +++ b/integrations/openshift/post_deploy @@ -25,6 +25,7 @@ import os import subprocess import sys +from typing import Dict sys.path.insert(0, os.path.dirname(__file__)) import zulip_openshift_config as config diff --git a/integrations/openshift/zulip_openshift_config.py b/integrations/openshift/zulip_openshift_config.py index b2af23d..6e36e5a 100755 --- a/integrations/openshift/zulip_openshift_config.py +++ b/integrations/openshift/zulip_openshift_config.py @@ -21,7 +21,7 @@ # THE SOFTWARE. # https://github.com/python/mypy/issues/1141 -from typing import Text +from typing import Dict, Text # Change these values to configure authentication for the plugin ZULIP_USER = 'openshift-bot@example.com' diff --git a/integrations/trac/zulip_trac.py b/integrations/trac/zulip_trac.py index b756685..bbfc317 100644 --- a/integrations/trac/zulip_trac.py +++ b/integrations/trac/zulip_trac.py @@ -43,7 +43,7 @@ import zulip_trac_config as config VERSION = "0.9" if False: - from typing import Any + from typing import Any, Dict if config.ZULIP_API_PATH is not None: sys.path.append(config.ZULIP_API_PATH) diff --git a/setup.py b/setup.py index ef0a026..190bc38 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from __future__ import print_function if False: - from typing import Any, Generator, List, Tuple + from typing import Any, Dict, Generator, List, Tuple import os import sys diff --git a/zulip/__init__.py b/zulip/__init__.py index 70bc82e..9745980 100644 --- a/zulip/__init__.py +++ b/zulip/__init__.py @@ -38,7 +38,7 @@ from six.moves.configparser import SafeConfigParser from six.moves import urllib import logging import six -from typing import Any, Callable, Dict, Iterable, IO, Mapping, Optional, Text, Tuple, Union +from typing import Any, Callable, Dict, Iterable, IO, List, Mapping, Optional, Text, Tuple, Union __version__ = "0.2.5"