diff --git a/tools/custom_check.py b/tools/custom_check.py index ff60e91..e834419 100644 --- a/tools/custom_check.py +++ b/tools/custom_check.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, List, Tuple +from typing import List from zulint.custom_rules import RuleList MYPY = False diff --git a/tools/deploy b/tools/deploy index e74d988..4ba8e52 100755 --- a/tools/deploy +++ b/tools/deploy @@ -9,7 +9,6 @@ import zipfile import textwrap import requests import urllib.parse -import json from requests import Response red = '\033[91m' # type: str diff --git a/tools/pep8.py b/tools/pep8.py index 4373590..47d740c 100644 --- a/tools/pep8.py +++ b/tools/pep8.py @@ -2,7 +2,6 @@ # Original path: zulip/tools/linter_lib/pep8.py import subprocess -import sys from zulint.printer import print_err, colors diff --git a/tools/server_lib/test_handler.py b/tools/server_lib/test_handler.py index fb797ec..a1d47e5 100644 --- a/tools/server_lib/test_handler.py +++ b/tools/server_lib/test_handler.py @@ -1,4 +1,3 @@ -from importlib import import_module import os import sys diff --git a/tools/test-bots b/tools/test-bots index 8295c06..5f62489 100755 --- a/tools/test-bots +++ b/tools/test-bots @@ -1,14 +1,12 @@ #!/usr/bin/env python3 from os.path import dirname, basename -from importlib import import_module import os import sys import argparse import glob import unittest -from unittest import TestCase, TestSuite import pytest def parse_args(): diff --git a/zulip/integrations/bridge_with_irc/irc-mirror.py b/zulip/integrations/bridge_with_irc/irc-mirror.py index 266cd51..0d767ff 100755 --- a/zulip/integrations/bridge_with_irc/irc-mirror.py +++ b/zulip/integrations/bridge_with_irc/irc-mirror.py @@ -8,7 +8,6 @@ import argparse import zulip import sys import traceback -from typing import Any, Dict usage = """./irc-mirror.py --irc-server=IRC_SERVER --channel= --nick-prefix= --stream= [optional args] diff --git a/zulip/integrations/bridge_with_irc/irc_mirror_backend.py b/zulip/integrations/bridge_with_irc/irc_mirror_backend.py index 5dfb3e5..3c5cdaa 100644 --- a/zulip/integrations/bridge_with_irc/irc_mirror_backend.py +++ b/zulip/integrations/bridge_with_irc/irc_mirror_backend.py @@ -1,6 +1,6 @@ import irc.bot import irc.strings -from irc.client import ip_numstr_to_quad, ip_quad_to_numstr, Event, ServerConnection +from irc.client import Event, ServerConnection, ip_numstr_to_quad from irc.client_aio import AioReactor import multiprocessing as mp from typing import Any, Dict diff --git a/zulip/integrations/google/get-google-credentials b/zulip/integrations/google/get-google-credentials index e17becb..2cc5abe 100644 --- a/zulip/integrations/google/get-google-credentials +++ b/zulip/integrations/google/get-google-credentials @@ -1,6 +1,4 @@ #!/usr/bin/env python3 -import datetime -import httplib2 import os from oauth2client import client diff --git a/zulip/integrations/google/google-calendar b/zulip/integrations/google/google-calendar index 72f2508..231c255 100755 --- a/zulip/integrations/google/google-calendar +++ b/zulip/integrations/google/google-calendar @@ -10,13 +10,11 @@ import logging import argparse import os import pytz -import urllib import sys import time -import traceback -from typing import List, Set, Tuple, Iterable, Optional +from typing import List, Optional, Set, Tuple -from oauth2client import client, tools +from oauth2client import client from oauth2client.file import Storage try: from googleapiclient import discovery diff --git a/zulip/integrations/hg/zulip_changegroup.py b/zulip/integrations/hg/zulip_changegroup.py index 4f6f357..b78d219 100755 --- a/zulip/integrations/hg/zulip_changegroup.py +++ b/zulip/integrations/hg/zulip_changegroup.py @@ -7,7 +7,7 @@ import zulip import sys -from typing import Any, Optional, Text +from typing import Text from mercurial import ui, repository as repo VERSION = "0.9" diff --git a/zulip/integrations/jabber/jabber_mirror.py b/zulip/integrations/jabber/jabber_mirror.py index 1fdb7f3..c14da4b 100755 --- a/zulip/integrations/jabber/jabber_mirror.py +++ b/zulip/integrations/jabber/jabber_mirror.py @@ -6,7 +6,6 @@ import os import traceback import signal from types import FrameType -from typing import Any from zulip import RandomExponentialBackoff def die(signal: int, frame: FrameType) -> None: diff --git a/zulip/integrations/jabber/jabber_mirror_backend.py b/zulip/integrations/jabber/jabber_mirror_backend.py index 8981ee3..88bc988 100755 --- a/zulip/integrations/jabber/jabber_mirror_backend.py +++ b/zulip/integrations/jabber/jabber_mirror_backend.py @@ -40,19 +40,14 @@ from typing import Dict, List, Set, Optional import logging -import threading import optparse from sleekxmpp import ClientXMPP, InvalidJID, JID from sleekxmpp.stanza import Message as JabberMessage -from sleekxmpp.exceptions import IqError, IqTimeout from configparser import SafeConfigParser -import getpass -import os import sys import zulip from zulip import Client -import re from typing import Any, Callable __version__ = "1.1" diff --git a/zulip/integrations/log2zulip/log2zulip b/zulip/integrations/log2zulip/log2zulip index 166a933..0c2e8c2 100755 --- a/zulip/integrations/log2zulip/log2zulip +++ b/zulip/integrations/log2zulip/log2zulip @@ -6,7 +6,6 @@ import os import platform import re import sys -import shutil import subprocess import tempfile import traceback diff --git a/zulip/integrations/nagios/nagios-notify-zulip b/zulip/integrations/nagios/nagios-notify-zulip index 09b786e..7c86bd3 100755 --- a/zulip/integrations/nagios/nagios-notify-zulip +++ b/zulip/integrations/nagios/nagios-notify-zulip @@ -2,7 +2,7 @@ import argparse import zulip -from typing import List, Text, Dict, Any +from typing import Any, Dict, Text VERSION = "0.9" # Nagios passes the notification details as command line options. diff --git a/zulip/integrations/perforce/zulip_change-commit.py b/zulip/integrations/perforce/zulip_change-commit.py index eecafc5..f029f68 100755 --- a/zulip/integrations/perforce/zulip_change-commit.py +++ b/zulip/integrations/perforce/zulip_change-commit.py @@ -23,7 +23,7 @@ import git_p4 __version__ = "0.1" sys.path.insert(0, os.path.dirname(__file__)) -from typing import Any, Dict, Optional, Text +from typing import Any, Dict, Optional import zulip_perforce_config as config if config.ZULIP_API_PATH is not None: diff --git a/zulip/integrations/svn/post-commit b/zulip/integrations/svn/post-commit index a97b12d..e88f760 100755 --- a/zulip/integrations/svn/post-commit +++ b/zulip/integrations/svn/post-commit @@ -13,7 +13,7 @@ import os import sys import os.path import pysvn -from typing import Any, Dict, List, Optional, Text, Tuple, Union +from typing import Any, Dict, Optional, Text, Tuple sys.path.insert(0, os.path.dirname(__file__)) import zulip_svn_config as config diff --git a/zulip/integrations/zephyr/check-mirroring b/zulip/integrations/zephyr/check-mirroring index 315cbd8..51f3821 100755 --- a/zulip/integrations/zephyr/check-mirroring +++ b/zulip/integrations/zephyr/check-mirroring @@ -2,7 +2,6 @@ import sys import time import optparse -import os import random import logging import subprocess diff --git a/zulip/integrations/zephyr/zephyr_mirror.py b/zulip/integrations/zephyr/zephyr_mirror.py index 0fceaad..27a6141 100755 --- a/zulip/integrations/zephyr/zephyr_mirror.py +++ b/zulip/integrations/zephyr/zephyr_mirror.py @@ -12,7 +12,6 @@ from zephyr_mirror_backend import parse_args (options, args) = parse_args() from types import FrameType -from typing import Any def die(signal: int, frame: FrameType) -> None: @@ -44,7 +43,6 @@ if options.forward_class_messages and not options.noshard: return 0 for (status, job) in run_parallel(run_job, jobs, threads=16): print("A mirroring shard died!") - pass sys.exit(0) backoff = RandomExponentialBackoff(timeout_success_equivalent=300) diff --git a/zulip/integrations/zephyr/zephyr_mirror_backend.py b/zulip/integrations/zephyr/zephyr_mirror_backend.py index 1e62854..617bc2e 100755 --- a/zulip/integrations/zephyr/zephyr_mirror_backend.py +++ b/zulip/integrations/zephyr/zephyr_mirror_backend.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -from typing import IO, Any, Dict, List, Text, Union, Set, Tuple, Optional, cast +from typing import Any, Dict, IO, List, Optional, Set, Text, Tuple, cast from types import FrameType import sys @@ -10,7 +10,6 @@ import time import subprocess import optparse import os -import datetime import textwrap import signal import logging diff --git a/zulip/zulip/examples/subscribe b/zulip/zulip/examples/subscribe index 5ba956c..fc3153d 100755 --- a/zulip/zulip/examples/subscribe +++ b/zulip/zulip/examples/subscribe @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -import sys import argparse usage = """subscribe [options] --streams= diff --git a/zulip/zulip/examples/unsubscribe b/zulip/zulip/examples/unsubscribe index 976dc5a..d55b90e 100755 --- a/zulip/zulip/examples/unsubscribe +++ b/zulip/zulip/examples/unsubscribe @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -import sys import argparse usage = """unsubscribe [options] --streams= diff --git a/zulip/zulip/send.py b/zulip/zulip/send.py index 48ff881..ea89460 100755 --- a/zulip/zulip/send.py +++ b/zulip/zulip/send.py @@ -5,7 +5,7 @@ import sys import argparse import logging -from typing import Any, Dict, List, Optional +from typing import Any, Dict import zulip diff --git a/zulip_bots/setup.py b/zulip_bots/setup.py index 385b6f7..3f9fd6f 100755 --- a/zulip_bots/setup.py +++ b/zulip_bots/setup.py @@ -2,8 +2,6 @@ import os import sys -import glob -import subprocess from typing import Any, Dict, Optional ZULIP_BOTS_VERSION = "0.6.4" diff --git a/zulip_bots/zulip_bots/bots/beeminder/beeminder.py b/zulip_bots/zulip_bots/bots/beeminder/beeminder.py index 98948c5..f4fad91 100644 --- a/zulip_bots/zulip_bots/bots/beeminder/beeminder.py +++ b/zulip_bots/zulip_bots/bots/beeminder/beeminder.py @@ -1,8 +1,7 @@ import requests import logging -import json -from typing import Dict, Any, List -from requests.exceptions import HTTPError, ConnectionError +from typing import Any, Dict +from requests.exceptions import ConnectionError help_message = ''' You can add datapoints towards your beeminder goals \ diff --git a/zulip_bots/zulip_bots/bots/beeminder/test_beeminder.py b/zulip_bots/zulip_bots/bots/beeminder/test_beeminder.py index 699658a..aedc53b 100644 --- a/zulip_bots/zulip_bots/bots/beeminder/test_beeminder.py +++ b/zulip_bots/zulip_bots/bots/beeminder/test_beeminder.py @@ -1,4 +1,4 @@ -from unittest.mock import patch, Mock +from unittest.mock import patch from zulip_bots.test_lib import StubBotHandler, BotTestCase, DefaultTests, get_bot_message_handler from requests.exceptions import ConnectionError diff --git a/zulip_bots/zulip_bots/bots/connect_four/controller.py b/zulip_bots/zulip_bots/bots/connect_four/controller.py index 0c4ef98..3120f1b 100644 --- a/zulip_bots/zulip_bots/bots/connect_four/controller.py +++ b/zulip_bots/zulip_bots/bots/connect_four/controller.py @@ -1,5 +1,4 @@ from copy import deepcopy -from random import randint from functools import reduce from zulip_bots.game_handler import BadMoveException diff --git a/zulip_bots/zulip_bots/bots/converter/converter.py b/zulip_bots/zulip_bots/bots/converter/converter.py index 88a05b7..1f2ef3c 100644 --- a/zulip_bots/zulip_bots/bots/converter/converter.py +++ b/zulip_bots/zulip_bots/bots/converter/converter.py @@ -1,10 +1,8 @@ # See readme.md for instructions on running this code. import copy -import importlib from math import log10, floor -import re from zulip_bots.bots.converter import utils from typing import Any, Dict, List diff --git a/zulip_bots/zulip_bots/bots/define/define.py b/zulip_bots/zulip_bots/bots/define/define.py index aa2314c..d3e9f27 100644 --- a/zulip_bots/zulip_bots/bots/define/define.py +++ b/zulip_bots/zulip_bots/bots/define/define.py @@ -1,6 +1,5 @@ # See readme.md for instructions on running this code. import logging -import json import requests import html2text import string diff --git a/zulip_bots/zulip_bots/bots/dialogflow/dialogflow.py b/zulip_bots/zulip_bots/bots/dialogflow/dialogflow.py index 6c3144a..ae99e20 100644 --- a/zulip_bots/zulip_bots/bots/dialogflow/dialogflow.py +++ b/zulip_bots/zulip_bots/bots/dialogflow/dialogflow.py @@ -1,11 +1,10 @@ # See readme.md for instructions on running this code. import logging -from urllib import parse import json import apiai -from typing import Dict, Any, List +from typing import Any, Dict help_message = '''DialogFlow bot This bot will interact with dialogflow bots. diff --git a/zulip_bots/zulip_bots/bots/file_uploader/test_file_uploader.py b/zulip_bots/zulip_bots/bots/file_uploader/test_file_uploader.py index 3018108..1723b67 100644 --- a/zulip_bots/zulip_bots/bots/file_uploader/test_file_uploader.py +++ b/zulip_bots/zulip_bots/bots/file_uploader/test_file_uploader.py @@ -1,4 +1,4 @@ -from unittest.mock import patch, MagicMock, Mock +from unittest.mock import Mock, patch from zulip_bots.test_lib import ( get_bot_message_handler, diff --git a/zulip_bots/zulip_bots/bots/front/front.py b/zulip_bots/zulip_bots/bots/front/front.py index 03a1c95..dc53a81 100644 --- a/zulip_bots/zulip_bots/bots/front/front.py +++ b/zulip_bots/zulip_bots/bots/front/front.py @@ -1,6 +1,6 @@ import requests import re -from typing import Any, Dict, Optional +from typing import Any, Dict class FrontHandler: FRONT_API = "https://api2.frontapp.com/conversations/{}" diff --git a/zulip_bots/zulip_bots/bots/game_of_fifteen/game_of_fifteen.py b/zulip_bots/zulip_bots/bots/game_of_fifteen/game_of_fifteen.py index 0e1a263..27038f1 100644 --- a/zulip_bots/zulip_bots/bots/game_of_fifteen/game_of_fifteen.py +++ b/zulip_bots/zulip_bots/bots/game_of_fifteen/game_of_fifteen.py @@ -1,5 +1,4 @@ import copy -import random from typing import List, Any, Tuple, Dict from zulip_bots.game_handler import GameAdapter, BadMoveException diff --git a/zulip_bots/zulip_bots/bots/giphy/test_giphy.py b/zulip_bots/zulip_bots/bots/giphy/test_giphy.py index 047cb44..8bf6eb4 100755 --- a/zulip_bots/zulip_bots/bots/giphy/test_giphy.py +++ b/zulip_bots/zulip_bots/bots/giphy/test_giphy.py @@ -1,5 +1,5 @@ from unittest.mock import patch -from requests.exceptions import HTTPError, ConnectionError +from requests.exceptions import ConnectionError from zulip_bots.test_lib import StubBotHandler, BotTestCase, DefaultTests, get_bot_message_handler diff --git a/zulip_bots/zulip_bots/bots/github_detail/github_detail.py b/zulip_bots/zulip_bots/bots/github_detail/github_detail.py index 83bc290..731b092 100644 --- a/zulip_bots/zulip_bots/bots/github_detail/github_detail.py +++ b/zulip_bots/zulip_bots/bots/github_detail/github_detail.py @@ -1,8 +1,5 @@ import re -import os -import sys import logging -import configparser import requests diff --git a/zulip_bots/zulip_bots/bots/google_search/google_search.py b/zulip_bots/zulip_bots/bots/google_search/google_search.py index a47769b..d7cb5da 100644 --- a/zulip_bots/zulip_bots/bots/google_search/google_search.py +++ b/zulip_bots/zulip_bots/bots/google_search/google_search.py @@ -1,12 +1,11 @@ # See readme.md for instructions on running this code. import logging -from urllib import parse import requests from bs4 import BeautifulSoup -from typing import Dict, Any, Union, List +from typing import Any, Dict, List def google_search(keywords: str) -> List[Dict[str, str]]: query = {'q': keywords} diff --git a/zulip_bots/zulip_bots/bots/google_translate/google_translate.py b/zulip_bots/zulip_bots/bots/google_translate/google_translate.py index 6614568..7db5d30 100644 --- a/zulip_bots/zulip_bots/bots/google_translate/google_translate.py +++ b/zulip_bots/zulip_bots/bots/google_translate/google_translate.py @@ -2,7 +2,6 @@ # googletranslate.conf in this (zulip_bots/bots/googletranslate/) directory. import requests -from requests.exceptions import HTTPError, ConnectionError class GoogleTranslateHandler: ''' diff --git a/zulip_bots/zulip_bots/bots/google_translate/test_google_translate.py b/zulip_bots/zulip_bots/bots/google_translate/test_google_translate.py index 8a1860b..8a777c4 100644 --- a/zulip_bots/zulip_bots/bots/google_translate/test_google_translate.py +++ b/zulip_bots/zulip_bots/bots/google_translate/test_google_translate.py @@ -2,7 +2,6 @@ from unittest.mock import patch from requests.exceptions import ConnectionError from zulip_bots.test_lib import BotTestCase, DefaultTests, StubBotHandler -from zulip_bots.bots.google_translate.google_translate import TranslateError help_text = ''' Google translate bot diff --git a/zulip_bots/zulip_bots/bots/idonethis/idonethis.py b/zulip_bots/zulip_bots/bots/idonethis/idonethis.py index 7bff9a5..cec1f1f 100644 --- a/zulip_bots/zulip_bots/bots/idonethis/idonethis.py +++ b/zulip_bots/zulip_bots/bots/idonethis/idonethis.py @@ -19,7 +19,6 @@ class TeamNotFoundException(Exception): class UnknownCommandSyntax(Exception): def __init__(self, detail: str) -> None: self.detail = detail - pass class UnspecifiedProblemException(Exception): pass diff --git a/zulip_bots/zulip_bots/bots/incident/incident.py b/zulip_bots/zulip_bots/bots/incident/incident.py index a0b7aef..3bbdfe5 100644 --- a/zulip_bots/zulip_bots/bots/incident/incident.py +++ b/zulip_bots/zulip_bots/bots/incident/incident.py @@ -1,10 +1,8 @@ -import html import json -import random import re from zulip_bots.lib import Any -from typing import Optional, Any, Dict, Tuple +from typing import Any, Dict, Tuple QUESTION = 'How should we handle this?' diff --git a/zulip_bots/zulip_bots/bots/jira/jira.py b/zulip_bots/zulip_bots/bots/jira/jira.py index 10ea287..ea97f6a 100644 --- a/zulip_bots/zulip_bots/bots/jira/jira.py +++ b/zulip_bots/zulip_bots/bots/jira/jira.py @@ -1,7 +1,7 @@ import base64 import re import requests -from typing import Any, Dict, Iterable, Optional +from typing import Any, Dict, Optional GET_REGEX = re.compile('get "(?P.+)"$') CREATE_REGEX = re.compile( diff --git a/zulip_bots/zulip_bots/bots/link_shortener/link_shortener.py b/zulip_bots/zulip_bots/bots/link_shortener/link_shortener.py index c14b785..be2e616 100644 --- a/zulip_bots/zulip_bots/bots/link_shortener/link_shortener.py +++ b/zulip_bots/zulip_bots/bots/link_shortener/link_shortener.py @@ -1,6 +1,5 @@ import re import requests -import logging from typing import Any, Dict diff --git a/zulip_bots/zulip_bots/bots/mention/mention.py b/zulip_bots/zulip_bots/bots/mention/mention.py index b078b41..1519ca5 100644 --- a/zulip_bots/zulip_bots/bots/mention/mention.py +++ b/zulip_bots/zulip_bots/bots/mention/mention.py @@ -2,7 +2,6 @@ import requests from typing import Any, List, Dict -import logging class MentionHandler: def initialize(self, bot_handler: Any) -> None: diff --git a/zulip_bots/zulip_bots/bots/merels/libraries/database.py b/zulip_bots/zulip_bots/bots/merels/libraries/database.py index c3e96e4..bfef128 100644 --- a/zulip_bots/zulip_bots/bots/merels/libraries/database.py +++ b/zulip_bots/zulip_bots/bots/merels/libraries/database.py @@ -10,8 +10,6 @@ finished yet so any matches that are finished will be removed. import json -from .constants import EMPTY_BOARD - class MerelsStorage(): def __init__(self, topic_name, storage): diff --git a/zulip_bots/zulip_bots/bots/merels/merels.py b/zulip_bots/zulip_bots/bots/merels/merels.py index 430e38f..9e723c8 100644 --- a/zulip_bots/zulip_bots/bots/merels/merels.py +++ b/zulip_bots/zulip_bots/bots/merels/merels.py @@ -5,7 +5,7 @@ from zulip_bots.bots.merels.libraries import ( database, game_data ) -from zulip_bots.game_handler import GameAdapter, SamePlayerMove, GameInstance +from zulip_bots.game_handler import GameAdapter, SamePlayerMove class Storage: data = {} diff --git a/zulip_bots/zulip_bots/bots/merels/test/test_database.py b/zulip_bots/zulip_bots/bots/merels/test/test_database.py index 61fd6ef..c3b3768 100644 --- a/zulip_bots/zulip_bots/bots/merels/test/test_database.py +++ b/zulip_bots/zulip_bots/bots/merels/test/test_database.py @@ -1,11 +1,8 @@ -import unittest from libraries import database from libraries import game_data from zulip_bots.simple_lib import SimpleStorage from zulip_bots.test_lib import BotTestCase, DefaultTests -from zulip_bots.game_handler import GameInstance -from merels import MerelsHandler class DatabaseTest(BotTestCase, DefaultTests): bot_name = 'merels' diff --git a/zulip_bots/zulip_bots/bots/salesforce/salesforce.py b/zulip_bots/zulip_bots/bots/salesforce/salesforce.py index c4c9e02..5f361e6 100644 --- a/zulip_bots/zulip_bots/bots/salesforce/salesforce.py +++ b/zulip_bots/zulip_bots/bots/salesforce/salesforce.py @@ -2,10 +2,8 @@ import simple_salesforce from typing import Dict, Any, List -import getpass import re import logging -import json from zulip_bots.bots.salesforce.utils import commands, object_types, link_query, default_query base_help_text = '''Salesforce bot diff --git a/zulip_bots/zulip_bots/bots/stack_overflow/stack_overflow.py b/zulip_bots/zulip_bots/bots/stack_overflow/stack_overflow.py index edfe19d..22dadb6 100644 --- a/zulip_bots/zulip_bots/bots/stack_overflow/stack_overflow.py +++ b/zulip_bots/zulip_bots/bots/stack_overflow/stack_overflow.py @@ -1,7 +1,5 @@ import requests import logging -import re -import urllib from typing import Optional, Any, Dict diff --git a/zulip_bots/zulip_bots/bots/susi/susi.py b/zulip_bots/zulip_bots/bots/susi/susi.py index 66514e4..d7818cd 100644 --- a/zulip_bots/zulip_bots/bots/susi/susi.py +++ b/zulip_bots/zulip_bots/bots/susi/susi.py @@ -1,5 +1,5 @@ import requests -from typing import Dict, Any, Tuple, Union +from typing import Any, Dict class SusiHandler: ''' diff --git a/zulip_bots/zulip_bots/bots/twitpost/test_twitpost.py b/zulip_bots/zulip_bots/bots/twitpost/test_twitpost.py index adc4c0d..0a24688 100644 --- a/zulip_bots/zulip_bots/bots/twitpost/test_twitpost.py +++ b/zulip_bots/zulip_bots/bots/twitpost/test_twitpost.py @@ -8,7 +8,6 @@ from zulip_bots.test_file_utils import ( read_bot_fixture_data, ) from unittest.mock import patch -import tweepy class TestTwitpostBot(BotTestCase, DefaultTests): bot_name = "twitpost" diff --git a/zulip_bots/zulip_bots/bots/twitpost/twitpost.py b/zulip_bots/zulip_bots/bots/twitpost/twitpost.py index 23f3e07..01595d9 100644 --- a/zulip_bots/zulip_bots/bots/twitpost/twitpost.py +++ b/zulip_bots/zulip_bots/bots/twitpost/twitpost.py @@ -1,6 +1,5 @@ -import zulip import tweepy -from typing import Dict, Any, Union, List, Tuple, Optional +from typing import Any, Dict class TwitpostBot: diff --git a/zulip_bots/zulip_bots/bots/virtual_fs/virtual_fs.py b/zulip_bots/zulip_bots/bots/virtual_fs/virtual_fs.py index a99c45e..73f1d9a 100644 --- a/zulip_bots/zulip_bots/bots/virtual_fs/virtual_fs.py +++ b/zulip_bots/zulip_bots/bots/virtual_fs/virtual_fs.py @@ -3,7 +3,7 @@ import re import os -from typing import Any, Dict, List, Tuple, Callable, Set, Union +from typing import Any, Dict, List, Set, Tuple, Union class VirtualFsHandler: META = { diff --git a/zulip_bots/zulip_bots/bots/weather/weather.py b/zulip_bots/zulip_bots/bots/weather/weather.py index c19c093..0403edb 100644 --- a/zulip_bots/zulip_bots/bots/weather/weather.py +++ b/zulip_bots/zulip_bots/bots/weather/weather.py @@ -1,7 +1,5 @@ # See readme.md for instructions on running this code. import requests -import json -import logging from typing import Any, Dict diff --git a/zulip_bots/zulip_bots/bots/wikipedia/wikipedia.py b/zulip_bots/zulip_bots/bots/wikipedia/wikipedia.py index 3e6f757..b554445 100644 --- a/zulip_bots/zulip_bots/bots/wikipedia/wikipedia.py +++ b/zulip_bots/zulip_bots/bots/wikipedia/wikipedia.py @@ -1,7 +1,5 @@ import requests import logging -import re -import urllib from zulip_bots.lib import Any from typing import Optional, Any, Dict diff --git a/zulip_bots/zulip_bots/bots/witai/witai.py b/zulip_bots/zulip_bots/bots/witai/witai.py index 0a63fa5..11256c1 100644 --- a/zulip_bots/zulip_bots/bots/witai/witai.py +++ b/zulip_bots/zulip_bots/bots/witai/witai.py @@ -2,7 +2,6 @@ from typing import Dict, Any, Optional, Callable import wit -import sys import importlib.util class WitaiHandler: diff --git a/zulip_bots/zulip_bots/bots/yoda/yoda.py b/zulip_bots/zulip_bots/bots/yoda/yoda.py index e940310..b0e2e50 100644 --- a/zulip_bots/zulip_bots/bots/yoda/yoda.py +++ b/zulip_bots/zulip_bots/bots/yoda/yoda.py @@ -1,7 +1,6 @@ # See readme.md for instructions on running this code. import logging import ssl -import sys import requests from typing import Any, Dict diff --git a/zulip_bots/zulip_bots/bots/youtube/youtube.py b/zulip_bots/zulip_bots/bots/youtube/youtube.py index f74fa4f..bbb5f53 100644 --- a/zulip_bots/zulip_bots/bots/youtube/youtube.py +++ b/zulip_bots/zulip_bots/bots/youtube/youtube.py @@ -1,6 +1,5 @@ import requests import logging -import sys from requests.exceptions import HTTPError, ConnectionError from typing import Dict, Any, Union, List, Tuple, Optional diff --git a/zulip_bots/zulip_bots/game_handler.py b/zulip_bots/zulip_bots/game_handler.py index 29dc02d..92c12cc 100644 --- a/zulip_bots/zulip_bots/game_handler.py +++ b/zulip_bots/zulip_bots/game_handler.py @@ -4,8 +4,6 @@ import random import logging from copy import deepcopy from typing import Any, Dict, Tuple, List -from zulip_bots.test_lib import BotTestCase -import operator import random diff --git a/zulip_bots/zulip_bots/lib.py b/zulip_bots/zulip_bots/lib.py index ca0f21a..a2ea6d2 100644 --- a/zulip_bots/zulip_bots/lib.py +++ b/zulip_bots/zulip_bots/lib.py @@ -11,7 +11,6 @@ import re from typing import Any, Optional, List, Dict, IO, Text from zulip import Client, ZulipError -from zulip_bots.custom_exceptions import ConfigValidationError class NoBotConfigException(Exception): diff --git a/zulip_bots/zulip_bots/provision.py b/zulip_bots/zulip_bots/provision.py index 55bdecf..ac84008 100755 --- a/zulip_bots/zulip_bots/provision.py +++ b/zulip_bots/zulip_bots/provision.py @@ -6,7 +6,6 @@ import os import sys import subprocess import glob -import pip from typing import Iterator def get_bot_paths() -> Iterator[str]: diff --git a/zulip_bots/zulip_bots/run.py b/zulip_bots/zulip_bots/run.py index 0634bf8..ed4b721 100755 --- a/zulip_bots/zulip_bots/run.py +++ b/zulip_bots/zulip_bots/run.py @@ -4,7 +4,6 @@ import logging import argparse import sys import os -from os.path import basename, splitext from zulip_bots.lib import ( zulip_env_vars_are_present, diff --git a/zulip_botserver/zulip_botserver/server.py b/zulip_botserver/zulip_botserver/server.py index fe204c4..33e2667 100644 --- a/zulip_botserver/zulip_botserver/server.py +++ b/zulip_botserver/zulip_botserver/server.py @@ -10,7 +10,7 @@ import importlib.util from configparser import MissingSectionHeaderError, NoOptionError from flask import Flask, request from importlib import import_module -from typing import Any, Dict, Union, List, Optional +from typing import Any, Dict, List, Optional from types import ModuleType from werkzeug.exceptions import BadRequest, Unauthorized