Skip to content

Commit

Permalink
tools: Remove unused imports.
Browse files Browse the repository at this point in the history
Signed-off-by: Anders Kaseorg <[email protected]>
  • Loading branch information
andersk authored and timabbott committed Feb 3, 2019
1 parent a0041af commit ee8ff4d
Show file tree
Hide file tree
Showing 24 changed files with 16 additions and 30 deletions.
2 changes: 1 addition & 1 deletion tools/check-issue-labels
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import sys
import os

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.
# GitHub API token is required as GitHub limits unauthenticated
Expand Down
2 changes: 1 addition & 1 deletion tools/check-templates
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ from lib import sanity_check
sanity_check.check_venv(__file__)

from zulint import lister
from typing import cast, Callable, Dict, Iterable, List
from typing import cast, Dict, Iterable, List

EXCLUDED_FILES = [
## Test data Files for testing modules in tests
Expand Down
3 changes: 1 addition & 2 deletions tools/create-test-api-docs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ from lib import sanity_check
sanity_check.check_venv(__file__)

from collections import defaultdict
from typing import Any, Dict, Iterable, List, Set
from typing import Any, Dict, List, Set

import cgi
import os
import pprint
import re
import ujson

Call = Dict[str, Any]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor
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 = [
# Google calendar returns 404s on HEAD requests unconditionally
Expand Down
1 change: 0 additions & 1 deletion tools/find-add-class
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from lib.find_add_class import display, find
import glob
import argparse
import sys

# check for the venv
from lib import sanity_check
Expand Down
2 changes: 1 addition & 1 deletion tools/lib/capitalization.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from typing import List, Tuple, Set, Pattern, Match
from typing import List, Tuple, Match
import re

from bs4 import BeautifulSoup
Expand Down
1 change: 0 additions & 1 deletion tools/lib/pretty_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from .template_parser import (
tokenize,
Token,
is_django_block_tag,
)
import subprocess
Expand Down
5 changes: 2 additions & 3 deletions tools/lib/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
import subprocess
import glob
import hashlib
import traceback

os.environ["PYTHONUNBUFFERED"] = "y"

ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

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
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,
FEDORA_VENV_DEPENDENCIES
)
Expand Down
2 changes: 1 addition & 1 deletion tools/lib/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from contextlib import contextmanager

from typing import (Any, Iterator, Optional)
from typing import Iterator, Optional

# Verify the Zulip venv is available.
from tools.lib import sanity_check
Expand Down
2 changes: 1 addition & 1 deletion tools/lint
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sanity_check.check_venv(__file__)

from zulint import lister
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

def run():
Expand Down
2 changes: 0 additions & 2 deletions tools/linter_lib/pep8.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from __future__ import print_function
from __future__ import absolute_import

import subprocess

from zulint.linters import run_pycodestyle

from typing import List
Expand Down
2 changes: 1 addition & 1 deletion tools/linter_lib/pyflakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from zulint.printer import print_err, colors

from typing import Any, Dict, List
from typing import List

suppress_patterns = [
(b'', b'imported but unused'),
Expand Down
1 change: 0 additions & 1 deletion tools/run-dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import signal
import subprocess
import sys
import time
import traceback

from urllib.parse import urlunparse
Expand Down
2 changes: 1 addition & 1 deletion tools/setup/emoji/build_emoji
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ from typing import Any, Dict, List, Optional

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, \
EMOJISETS, EMOTICON_CONVERSIONS, REMAPPED_EMOJIS
EMOTICON_CONVERSIONS, REMAPPED_EMOJIS
from emoji_names import EMOJI_NAME_MAPS

ZULIP_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../')
Expand Down
2 changes: 1 addition & 1 deletion tools/setup/setup_venvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
sys.path.append(ZULIP_PATH)

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"

Expand Down
4 changes: 1 addition & 3 deletions tools/test-api
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ from zulip import Client

from tools.lib.test_script import get_provisioning_status
from tools.lib.test_server import test_server_running
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
from zerver.lib.api_test_helpers import test_the_api, test_invalid_api_key

os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.test_settings'
django.setup()
Expand Down
1 change: 0 additions & 1 deletion tools/test-backend
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python3

from typing import List, Any
from mypy_extensions import NoReturn
import glob
import argparse
import os
Expand Down
1 change: 0 additions & 1 deletion tools/test-js-with-node
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python3
import argparse
import os
import shutil
import subprocess
import sys
from typing import Dict, Any
Expand Down
2 changes: 1 addition & 1 deletion tools/test-locked-requirements
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import sys
import tempfile
import ujson

from typing import Optional, List, Tuple
from typing import Optional, List

TOOLS_DIR = os.path.abspath(os.path.dirname(__file__))
ZULIP_PATH = os.path.dirname(TOOLS_DIR)
Expand Down
2 changes: 1 addition & 1 deletion tools/tests/test_template_parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, Any
from typing import Optional

import sys
import unittest
Expand Down
1 change: 0 additions & 1 deletion tools/update-authors-json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.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')
duplicate_commits_file = os.path.join(os.path.dirname(__file__),
Expand Down
2 changes: 1 addition & 1 deletion tools/zulint/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

if False:
# 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

Expand Down
1 change: 0 additions & 1 deletion tools/zulint/printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from __future__ import absolute_import

import sys
import os
from itertools import cycle
if False:
# See https://zulip.readthedocs.io/en/latest/testing/mypy.html#mypy-in-production-scripts
Expand Down
1 change: 0 additions & 1 deletion tools/zulip-export/zulip-export
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import sys
import os
import argparse
import time
import json
usage = """Export all messages on a given stream to a JSON dump.
Expand Down

0 comments on commit ee8ff4d

Please sign in to comment.