Skip to content

Commit

Permalink
Remove unused imports (python#6905)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilevkivskyi authored May 28, 2019
1 parent 5f08ccf commit 95a0491
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 35 deletions.
1 change: 0 additions & 1 deletion misc/convert-cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

import argparse
from typing import Any
from mypy.metastore import FilesystemMetadataStore, SqliteMetadataStore


Expand Down
3 changes: 1 addition & 2 deletions mypy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@
"""

import sys
from io import StringIO
from typing import List, Tuple, Union, TextIO, Callable
from typing import List, Tuple, TextIO, Callable


def _run(main_wrapper: Callable[[TextIO, TextIO], None]) -> Tuple[str, str, int]:
Expand Down
2 changes: 0 additions & 2 deletions mypy/bogus_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
For those cases some other technique should be used.
"""

import sys

from mypy_extensions import FlexibleAlias
from typing import TypeVar, Any

Expand Down
1 change: 0 additions & 1 deletion mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"""
# TODO: More consistent terminology, e.g. path/fnam, module/id, state/file

import binascii
import contextlib
import errno
import gc
Expand Down
9 changes: 2 additions & 7 deletions mypy/main.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
"""Mypy type checker command line tool."""

import argparse
import ast
import configparser
import glob as fileglob
import os
import re
import subprocess
import sys
import time

from typing import Any, Dict, List, Mapping, Optional, Tuple, TextIO
from io import StringIO
from typing import Dict, List, Optional, Tuple, TextIO

from mypy import build
from mypy import defaults
Expand All @@ -21,7 +16,7 @@
from mypy.find_sources import create_source_list, InvalidSourceList
from mypy.fscache import FileSystemCache
from mypy.errors import CompileError
from mypy.options import Options, BuildType, PER_MODULE_OPTIONS
from mypy.options import Options, BuildType
from mypy.config_parser import parse_version, parse_config_file
from mypy.split_namespace import SplitNamespace

Expand Down
1 change: 0 additions & 1 deletion mypy/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
ReturnStmt, NameExpr, Var, CONTRAVARIANT, COVARIANT, SymbolNode,
CallExpr
)
from mypy.defaults import PYTHON3_VERSION
from mypy.util import unmangle
from mypy import message_registry

Expand Down
4 changes: 2 additions & 2 deletions mypy/mixedtraverser.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import Optional

from mypy.nodes import (
MypyFile, Var, FuncItem, ClassDef, AssignmentStmt, OperatorAssignmentStmt, ForStmt, WithStmt,
Var, FuncItem, ClassDef, AssignmentStmt, ForStmt, WithStmt,
CastExpr, TypeApplication, TypeAliasExpr, TypeVarExpr, TypedDictExpr, NamedTupleExpr,
EnumCallExpr, PromoteExpr, NewTypeExpr
PromoteExpr, NewTypeExpr
)
from mypy.types import Type
from mypy.traverser import TraverserVisitor
Expand Down
1 change: 0 additions & 1 deletion mypy/newsemanal/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
)
from mypy.exprtotype import expr_to_unanalyzed_type, TypeTranslationError
from mypy.options import Options
from mypy import state
from mypy.plugin import (
Plugin, ClassDefContext, SemanticAnalyzerPluginInterface,
DynamicClassDefContext
Expand Down
2 changes: 1 addition & 1 deletion mypy/newsemanal/semanal_typeargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from typing import List

from mypy.nodes import TypeInfo, Context, MypyFile, FuncItem, ClassDef, Block, OverloadedFuncDef
from mypy.nodes import TypeInfo, Context, MypyFile, FuncItem, ClassDef, Block
from mypy.types import Type, Instance, TypeVarType, AnyType, TypeOfAny
from mypy.mixedtraverser import MixedTraverserVisitor
from mypy.subtypes import is_subtype
Expand Down
2 changes: 1 addition & 1 deletion mypy/newsemanal/semanal_typeddict.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from mypy.nodes import (
CallExpr, TypedDictExpr, Expression, NameExpr, Context, StrExpr, BytesExpr, UnicodeExpr,
ClassDef, RefExpr, TypeInfo, AssignmentStmt, PassStmt, ExpressionStmt, EllipsisExpr, TempNode,
SymbolTableNode, DictExpr, GDEF, ARG_POS, ARG_NAMED
DictExpr, ARG_POS, ARG_NAMED
)
from mypy.newsemanal.semanal_shared import SemanticAnalyzerInterface
from mypy.exprtotype import expr_to_unanalyzed_type, TypeTranslationError
Expand Down
4 changes: 2 additions & 2 deletions mypy/plugins/common.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List, Optional, Any
from typing import List, Optional

from mypy.nodes import (
ARG_POS, MDEF, Argument, Block, CallExpr, Expression, FuncBase, SYMBOL_FUNCBASE_TYPES,
ARG_POS, MDEF, Argument, Block, CallExpr, Expression, SYMBOL_FUNCBASE_TYPES,
FuncDef, PassStmt, RefExpr, SymbolTableNode, Var, StrExpr,
)
from mypy.plugin import ClassDefContext
Expand Down
2 changes: 1 addition & 1 deletion mypy/semanal_newtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from typing import Tuple, Optional

from mypy.types import Type, Instance, CallableType, NoneType, TupleType, AnyType, TypeOfAny
from mypy.types import Type, Instance, CallableType, NoneType, TupleType, AnyType
from mypy.nodes import (
AssignmentStmt, NewTypeExpr, CallExpr, NameExpr, RefExpr, Context, StrExpr, BytesExpr,
UnicodeExpr, Block, FuncDef, Argument, TypeInfo, Var, SymbolTableNode, GDEF, MDEF, ARG_POS
Expand Down
12 changes: 5 additions & 7 deletions mypy/suggestions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,27 @@
"""

from typing import (
List, Optional, Set, Tuple, Dict, Callable, Union, NamedTuple, TypeVar, Iterator,
List, Optional, Tuple, Dict, Callable, Union, NamedTuple, TypeVar, Iterator,
)

import mypy.checker
import mypy.types
from mypy.state import strict_optional_set
from mypy.types import (
Type, AnyType, TypeOfAny, CallableType, UnionType, NoneType, Instance, TupleType, is_optional,
TypeStrVisitor,
)
from mypy.build import State, Graph
from mypy.nodes import (
ARG_POS, ARG_STAR, ARG_NAMED, ARG_STAR2, ARG_NAMED_OPT, FuncDef, MypyFile, SymbolTable,
SymbolNode, TypeInfo, Node, Expression, ReturnStmt,
ARG_STAR, ARG_NAMED, ARG_STAR2, ARG_NAMED_OPT, FuncDef, MypyFile, SymbolTable,
SymbolNode, TypeInfo, Expression, ReturnStmt,
reverse_builtin_aliases,
)
from mypy.server.update import FineGrainedBuildManager
from mypy.server.target import module_prefix, split_target
from mypy.plugin import Plugin, ChainedPlugin, FunctionContext, MethodContext
from mypy.plugin import Plugin, FunctionContext, MethodContext
from mypy.traverser import TraverserVisitor
from mypy.checkexpr import has_any_type

from mypy.join import join_types, join_type_list
from mypy.join import join_type_list
from mypy.sametypes import is_same_type

from contextlib import contextmanager
Expand Down
1 change: 0 additions & 1 deletion mypy/traverser.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
ConditionalExpr, TypeApplication, ExecStmt, Import, ImportFrom,
LambdaExpr, ComparisonExpr, OverloadedFuncDef, YieldFromExpr,
YieldExpr, StarExpr, BackquoteExpr, AwaitExpr, PrintStmt, SuperExpr, REVEAL_TYPE,
Statement
)


Expand Down
6 changes: 2 additions & 4 deletions mypy/util.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
"""Utility functions with no non-trivial dependencies."""
import contextlib
import os
import pathlib
import re
import subprocess
import sys
from types import TracebackType
from typing import TypeVar, List, Tuple, Optional, Dict, Sequence, TextIO
from typing import TypeVar, List, Tuple, Optional, Dict, Sequence

MYPY = False
if MYPY:
from typing import Type, ClassVar
from typing import Type
from typing_extensions import Final

T = TypeVar('T')
Expand Down
2 changes: 1 addition & 1 deletion scripts/stubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import importlib
import sys
from typing import Dict, Any, List
from typing import Dict, Any
from collections import defaultdict, namedtuple

from mypy import build
Expand Down

0 comments on commit 95a0491

Please sign in to comment.