From 47d8ab8f9a69449c3d274c7295c7008724259104 Mon Sep 17 00:00:00 2001 From: Alena Volkova Date: Wed, 11 Oct 2017 19:56:42 -0400 Subject: [PATCH] mypy: zulip_bots: Fix errors in zulip_bots/provision.py. --- tools/run-mypy | 1 - zulip_bots/zulip_bots/provision.py | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/run-mypy b/tools/run-mypy index b6c077e..830ac43 100755 --- a/tools/run-mypy +++ b/tools/run-mypy @@ -22,7 +22,6 @@ exclude = """ zulip/integrations/perforce/git_p4.py zulip_bots/zulip_bots/bots -zulip_bots/zulip_bots/provision.py zulip_bots/zulip_bots/run.py zulip_bots/zulip_bots/test_lib.py zulip_bots/zulip_bots/test_run.py diff --git a/zulip_bots/zulip_bots/provision.py b/zulip_bots/zulip_bots/provision.py index 86686ef..a995490 100755 --- a/zulip_bots/zulip_bots/provision.py +++ b/zulip_bots/zulip_bots/provision.py @@ -8,6 +8,7 @@ import os import sys import glob import pip +from typing import Iterator def provision_bot(path_to_bot, force): # type: (str, bool) -> None @@ -35,6 +36,7 @@ def provision_bot(path_to_bot, force): def parse_args(available_bots): + # type: (Iterator[str]) -> argparse.Namespace usage = """ Installs dependencies of bots in the bots/ directories. Add a requirements.txt file in a bot's folder @@ -72,7 +74,7 @@ def main(): # type: () -> None current_dir = os.path.dirname(os.path.abspath(__file__)) bots_dir = os.path.join(current_dir, "bots") - bots_subdirs = map(os.path.abspath, glob.glob(bots_dir + '/*')) + bots_subdirs = map(lambda d: os.path.abspath(d), glob.glob(bots_dir + '/*')) available_bots = filter(lambda d: os.path.isdir(d), bots_subdirs) options = parse_args(available_bots)