tools: Remove unused imports.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
Anders Kaseorg 2019-02-02 14:53:29 -08:00 committed by Tim Abbott
parent a0041afaf9
commit ee8ff4df66
24 changed files with 16 additions and 30 deletions

View File

@ -7,7 +7,7 @@ import sys
import os import os
import ConfigParser import ConfigParser
from typing import Any, Dict, MutableMapping, Optional from typing import Any, Dict, Optional
# Scans zulip repositary for issues that don't have any `area` labels. # Scans zulip repositary for issues that don't have any `area` labels.
# GitHub API token is required as GitHub limits unauthenticated # GitHub API token is required as GitHub limits unauthenticated

View File

@ -11,7 +11,7 @@ from lib import sanity_check
sanity_check.check_venv(__file__) sanity_check.check_venv(__file__)
from zulint import lister from zulint import lister
from typing import cast, Callable, Dict, Iterable, List from typing import cast, Dict, Iterable, List
EXCLUDED_FILES = [ EXCLUDED_FILES = [
## Test data Files for testing modules in tests ## Test data Files for testing modules in tests

View File

@ -5,12 +5,11 @@ from lib import sanity_check
sanity_check.check_venv(__file__) sanity_check.check_venv(__file__)
from collections import defaultdict from collections import defaultdict
from typing import Any, Dict, Iterable, List, Set from typing import Any, Dict, List, Set
import cgi import cgi
import os import os
import pprint import pprint
import re
import ujson import ujson
Call = Dict[str, Any] Call = Dict[str, Any]

View File

@ -7,7 +7,7 @@ from scrapy.linkextractors import IGNORED_EXTENSIONS
from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor
from scrapy.utils.url import url_has_any_extension from scrapy.utils.url import url_has_any_extension
from typing import Any, Generator, List, Optional, Tuple from typing import Any, Generator, List, Optional
EXCLUDED_URLS = [ EXCLUDED_URLS = [
# Google calendar returns 404s on HEAD requests unconditionally # Google calendar returns 404s on HEAD requests unconditionally

View File

@ -3,7 +3,6 @@
from lib.find_add_class import display, find from lib.find_add_class import display, find
import glob import glob
import argparse import argparse
import sys
# check for the venv # check for the venv
from lib import sanity_check from lib import sanity_check

View File

@ -1,5 +1,5 @@
from typing import List, Tuple, Set, Pattern, Match from typing import List, Tuple, Match
import re import re
from bs4 import BeautifulSoup from bs4 import BeautifulSoup

View File

@ -3,7 +3,6 @@ from typing import Any, Dict, List
from .template_parser import ( from .template_parser import (
tokenize, tokenize,
Token,
is_django_block_tag, is_django_block_tag,
) )
import subprocess import subprocess

View File

@ -7,17 +7,16 @@ import platform
import subprocess import subprocess
import glob import glob
import hashlib import hashlib
import traceback
os.environ["PYTHONUNBUFFERED"] = "y" os.environ["PYTHONUNBUFFERED"] = "y"
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ZULIP_PATH) sys.path.append(ZULIP_PATH)
from scripts.lib.zulip_tools import run, subprocess_text_output, OKBLUE, ENDC, WARNING, \ from scripts.lib.zulip_tools import run, OKBLUE, ENDC, WARNING, \
get_dev_uuid_var_path, FAIL, parse_lsb_release, file_or_package_hash_updated get_dev_uuid_var_path, FAIL, parse_lsb_release, file_or_package_hash_updated
from scripts.lib.setup_venv import ( from scripts.lib.setup_venv import (
setup_virtualenv, VENV_DEPENDENCIES, REDHAT_VENV_DEPENDENCIES, VENV_DEPENDENCIES, REDHAT_VENV_DEPENDENCIES,
THUMBOR_VENV_DEPENDENCIES, YUM_THUMBOR_VENV_DEPENDENCIES, THUMBOR_VENV_DEPENDENCIES, YUM_THUMBOR_VENV_DEPENDENCIES,
FEDORA_VENV_DEPENDENCIES FEDORA_VENV_DEPENDENCIES
) )

View File

@ -6,7 +6,7 @@ import time
from contextlib import contextmanager from contextlib import contextmanager
from typing import (Any, Iterator, Optional) from typing import Iterator, Optional
# Verify the Zulip venv is available. # Verify the Zulip venv is available.
from tools.lib import sanity_check from tools.lib import sanity_check

View File

@ -12,7 +12,7 @@ sanity_check.check_venv(__file__)
from zulint import lister from zulint import lister
from zulint.command import add_default_linter_arguments, LinterConfig from zulint.command import add_default_linter_arguments, LinterConfig
from typing import cast, Callable, Dict, Iterator, List from typing import cast, Dict, List
import random import random
def run(): def run():

View File

@ -1,8 +1,6 @@
from __future__ import print_function from __future__ import print_function
from __future__ import absolute_import from __future__ import absolute_import
import subprocess
from zulint.linters import run_pycodestyle from zulint.linters import run_pycodestyle
from typing import List from typing import List

View File

@ -6,7 +6,7 @@ import subprocess
from zulint.printer import print_err, colors from zulint.printer import print_err, colors
from typing import Any, Dict, List from typing import List
suppress_patterns = [ suppress_patterns = [
(b'', b'imported but unused'), (b'', b'imported but unused'),

View File

@ -6,7 +6,6 @@ import pwd
import signal import signal
import subprocess import subprocess
import sys import sys
import time
import traceback import traceback
from urllib.parse import urlunparse from urllib.parse import urlunparse

View File

@ -11,7 +11,7 @@ from typing import Any, Dict, List, Optional
from emoji_setup_utils import generate_emoji_catalog, generate_codepoint_to_name_map, \ from emoji_setup_utils import generate_emoji_catalog, generate_codepoint_to_name_map, \
get_emoji_code, generate_name_to_codepoint_map, emoji_names_for_picker, \ get_emoji_code, generate_name_to_codepoint_map, emoji_names_for_picker, \
EMOJISETS, EMOTICON_CONVERSIONS, REMAPPED_EMOJIS EMOTICON_CONVERSIONS, REMAPPED_EMOJIS
from emoji_names import EMOJI_NAME_MAPS from emoji_names import EMOJI_NAME_MAPS
ZULIP_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../') ZULIP_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../')

View File

@ -8,7 +8,7 @@ if ZULIP_PATH not in sys.path:
sys.path.append(ZULIP_PATH) sys.path.append(ZULIP_PATH)
from scripts.lib.setup_venv import setup_virtualenv from scripts.lib.setup_venv import setup_virtualenv
from scripts.lib.zulip_tools import run, subprocess_text_output from scripts.lib.zulip_tools import subprocess_text_output
VENV_PATH = "/srv/zulip-py3-venv" VENV_PATH = "/srv/zulip-py3-venv"

View File

@ -16,9 +16,7 @@ from zulip import Client
from tools.lib.test_script import get_provisioning_status from tools.lib.test_script import get_provisioning_status
from tools.lib.test_server import test_server_running from tools.lib.test_server import test_server_running
from zerver.lib.api_test_helpers import test_the_api, test_invalid_api_key, \ from zerver.lib.api_test_helpers import test_the_api, test_invalid_api_key
test_update_message_edit_permission_error, \
test_user_not_authorized_error, test_authorization_errors_fatal
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.test_settings' os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.test_settings'
django.setup() django.setup()

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from typing import List, Any from typing import List, Any
from mypy_extensions import NoReturn
import glob import glob
import argparse import argparse
import os import os

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse import argparse
import os import os
import shutil
import subprocess import subprocess
import sys import sys
from typing import Dict, Any from typing import Dict, Any

View File

@ -10,7 +10,7 @@ import sys
import tempfile import tempfile
import ujson import ujson
from typing import Optional, List, Tuple from typing import Optional, List
TOOLS_DIR = os.path.abspath(os.path.dirname(__file__)) TOOLS_DIR = os.path.abspath(os.path.dirname(__file__))
ZULIP_PATH = os.path.dirname(TOOLS_DIR) ZULIP_PATH = os.path.dirname(TOOLS_DIR)

View File

@ -1,4 +1,4 @@
from typing import Optional, Any from typing import Optional
import sys import sys
import unittest import unittest

View File

@ -24,7 +24,6 @@ import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.settings' os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.settings'
from django.conf import settings from django.conf import settings
from zerver.lib.utils import split_by
FIXTURE_FILE = os.path.join(os.path.dirname(__file__), '../zerver/tests/fixtures/authors.json') FIXTURE_FILE = os.path.join(os.path.dirname(__file__), '../zerver/tests/fixtures/authors.json')
duplicate_commits_file = os.path.join(os.path.dirname(__file__), duplicate_commits_file = os.path.join(os.path.dirname(__file__),

View File

@ -11,7 +11,7 @@ import sys
if False: if False:
# See https://zulip.readthedocs.io/en/latest/testing/mypy.html#mypy-in-production-scripts # See https://zulip.readthedocs.io/en/latest/testing/mypy.html#mypy-in-production-scripts
from typing import Any, Callable, Dict, List, Optional from typing import Any, Callable, Dict, List
from zulint.printer import print_err, colors from zulint.printer import print_err, colors

View File

@ -2,7 +2,6 @@ from __future__ import print_function
from __future__ import absolute_import from __future__ import absolute_import
import sys import sys
import os
from itertools import cycle from itertools import cycle
if False: if False:
# See https://zulip.readthedocs.io/en/latest/testing/mypy.html#mypy-in-production-scripts # See https://zulip.readthedocs.io/en/latest/testing/mypy.html#mypy-in-production-scripts

View File

@ -24,7 +24,6 @@
import sys import sys
import os import os
import argparse import argparse
import time
import json import json
usage = """Export all messages on a given stream to a JSON dump. usage = """Export all messages on a given stream to a JSON dump.