From 25d6c68d4dc200ee9c87dbf789dd53d5d36ccc1c Mon Sep 17 00:00:00 2001 From: Alena Volkova Date: Wed, 11 Oct 2017 01:55:18 -0400 Subject: [PATCH] mypy: zulip_botserver: Fix errors in setup.py. --- tools/run-mypy | 1 - zulip_botserver/setup.py | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/run-mypy b/tools/run-mypy index 03585c2..5b8a79a 100755 --- a/tools/run-mypy +++ b/tools/run-mypy @@ -21,7 +21,6 @@ sys.path.append(os.path.dirname(TOOLS_DIR)) exclude = """ zulip/integrations/perforce/git_p4.py zulip_bots/zulip_bots/bots -zulip_botserver/setup.py """.split() parser = argparse.ArgumentParser(description="Run mypy on files tracked by git.") diff --git a/zulip_botserver/setup.py b/zulip_botserver/setup.py index b5f4997..0ba8784 100644 --- a/zulip_botserver/setup.py +++ b/zulip_botserver/setup.py @@ -5,6 +5,8 @@ from __future__ import print_function import os import sys +if False: + from typing import Any, Dict, Optional ZULIP_BOTSERVER_VERSION = "0.3.7" @@ -51,14 +53,15 @@ except ImportError: # Manual dependency check def check_dependency_manually(module_name, version=None): + # type: (str, Optional[str]) -> None try: - module = import_module(module_name) + module = import_module(module_name) # type: Any if version is not None: assert(LooseVersion(module.__version__) >= LooseVersion(version)) except (ImportError, AssertionError): if version is not None: print("{name}>={version} is not installed.".format( - req=req, version=version), file=sys.stderr) + name=module_name, version=version), file=sys.stderr) else: print("{name} is not installed.".format(name=module_name), file=sys.stderr) sys.exit(1)