8000 Fix flake8 F401 violations (unused imports) (#233) · audacious-io/graphql-core@8f7c8f3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8f7c8f3

Browse files
authored
Fix flake8 F401 violations (unused imports) (graphql-python#233)
Fix flake8 F401 violations (unused imports)
1 parent 9d558c3 commit 8f7c8f3

22 files changed

+24
-73
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ repos:
2626
rev: 3.7.7
2727
hooks:
2828
- id: flake8
29-
exclude: (^docs/.*$|^scripts/generate_ast.py$|test_.*$)
29+
exclude: test_.*$

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import sys
1616
import os
17-
import shlex
1817

1918
# If extensions (or modules to document with autodoc) are in another directory,
2019
# add these directories to sys.path here. If the directory is relative to the

graphql/backend/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
from .decider import GraphQLDeciderBackend
1010
from .cache import GraphQLCachedBackend
1111

12-
# Necessary for static type checking
13-
if False: # flake8: noqa
14-
from typing import Union
1512

1613
_default_backend = None
1714

graphql/backend/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# Necessary for static type checking
99
if False: # flake8: noqa
10-
from typing import Any, Dict, Optional, Union, Tuple, Hashable
10+
from typing import Dict, Optional, Hashable
1111
from .base import GraphQLDocument
1212

1313
_cached_schemas = {} # type: Dict[GraphQLSchema, str]

graphql/backend/decider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
# Necessary for static type checking
1313
if False: # flake8: noqa
14-
from typing import List, Union, Any, Optional, Hashable, Dict, Tuple, Type
14+
from typing import List, Union, Optional, Hashable, Dict, Tuple, Type
1515
from ..type.schema import GraphQLSchema
1616

1717

graphql/error/format_error.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Necessary for static type checking
44
if False: # flake8: noqa
5-
from typing import Any, Dict, Union
5+
from typing import Any, Dict
66

77

88
def format_error(error):

graphql/execution/executors/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
if False: # flake8: noqa
55
from ..base import ResolveInfo
66
from promise import Promise
7-
from typing import Callable, Dict, Tuple, Union, Any
7+
from typing import Callable, Dict, Tuple, Any
88

99

1010
def process(

graphql/execution/middleware.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
from functools import partial
33
from itertools import chain
44

5-
from promise import Promise, promisify
5+
from promise import promisify
66

77
# Necessary for static type checking
88
if False: # flake8: noqa
9-
from .base import ResolveInfo
10-
from typing import Any, Callable, Iterator, Tuple, Union, List, Dict, Iterable
9+
from typing import Any, Callable, Iterator, Tuple, Dict, Iterable
1110

1211
MIDDLEWARE_RESOLVER_FUNCTION = "resolve"
1312

graphql/language/ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Necessary for static type checking
22
if False: # flake8: noqa
33
from .parser import Loc
4-
from typing import Any, Optional, Union, List, Tuple, Iterable
4+
from typing import Any, Optional, Union, List, Iterable
55

66
# This is autogenerated code. DO NOT change this manually.
77
# Run scripts/generate_ast.py to generate this file.

graphql/language/printer.py

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,8 @@
44

55
# Necessary for static type checking
66
if False: # flake8: noqa
7-
from typing import Any, List, Optional, Union
8-
from graphql.language.ast import (
9-
Node,
10-
Name,
11-
Variable,
12-
Document,
13-
OperationDefinition,
14-
VariableDefinition,
15-
SelectionSet,
16-
Field,
17-
Argument,
18-
FragmentSpread,
19-
InlineFragment,
20-
FragmentDefinition,
21-
IntValue,
22-
StringValue,
23-
BooleanValue,
24-
EnumValue,
25-
ListValue,
26-
ObjectValue,
27-
ObjectField,
28-
Directive,
29-
NamedType,
30-
ListType,
31-
NonNullType,
32-
SchemaDefinition,
33-
OperationTypeDefinition,
34-
ScalarTypeDefinition,
35-
ObjectTypeDefinition,
36-
FieldDefinition,
37-
InputValueDefinition,
38-
InterfaceTypeDefinition,
39-
UnionTypeDefinition,
40-
EnumTypeDefinition,
41-
EnumValueDefinition,
42-
InputObjectTypeDefinition,
43-
TypeExtensionDefinition,
44-
DirectiveDefinition,
45-
)
7+
from typing import Any, List, Optional
8+
from graphql.language.ast import Node
469

4710
__all__ = ["print_ast"]
4811

0 commit comments

Comments
 (0)
0