Skip to content

Commit d6254c8

Browse files
committed
Update mypy and other tools
1 parent b43c820 commit d6254c8

22 files changed

+441
-296
lines changed

poetry.lock

Lines changed: 426 additions & 248 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Changelog = "https://github.com/graphql-python/graphql-core/releases"
4242
[tool.poetry.dependencies]
4343
python = "^3.7"
4444
typing-extensions = [
45-
{ version = "^4.4", python = "<3.10" }
45+
{ version = "^4.5", python = "<3.10" }
4646
]
4747

4848
[tool.poetry.group.test]
@@ -61,15 +61,18 @@ tox = ">=3.0"
6161
optional = true
6262

6363
[tool.poetry.group.lint.dependencies]
64-
black = "22.12.0"
64+
black = "23.1.0"
6565
flake8 = [
6666
{ version = ">=5,<7", python = ">=3.8" },
6767
{ version = ">=5,<6", python = "<3.8" }
6868
]
6969
flake8-bandit = "^4.1"
70-
flake8-bugbear = "22.12.6"
71-
isort = "^5.11"
72-
mypy = "0.991"
70+
flake8-bugbear = "23.2.13"
71+
isort = [
72+
{ version = "^5.12", python = ">=3.8" },
73+
{ version = "^5.11", python = "<3.8" }
74+
]
75+
mypy = "1.0.0"
7376
bump2version = ">=1.0,<2"
7477

7578
[tool.poetry.group.doc]

src/graphql/execution/execute.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,6 @@ def execute_subscription(
14181418

14191419
result = resolve_fn(context.root_value, info, **args)
14201420
if context.is_awaitable(result):
1421-
14221421
# noinspection PyShadowingNames
14231422
async def await_result() -> AsyncIterable[Any]:
14241423
try:

src/graphql/language/ast.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ def __hash__(self) -> int:
240240

241241

242242
class OperationType(Enum):
243-
244243
QUERY = "query"
245244
MUTATION = "mutation"
246245
SUBSCRIPTION = "subscription"
@@ -479,7 +478,6 @@ class ArgumentNode(Node):
479478

480479

481480
class ConstArgumentNode(ArgumentNode):
482-
483481
value: ConstValueNode
484482

485483

@@ -561,7 +559,6 @@ class ListValueNode(ValueNode):
561559

562560

563561
class ConstListValueNode(ListValueNode):
564-
565562
values: Tuple[ConstValueNode, ...]
566563

567564

@@ -572,7 +569,6 @@ class ObjectValueNode(ValueNode):
572569

573570

574571
class ConstObjectValueNode(ObjectValueNode):
575-
576572
fields: Tuple[ConstObjectFieldNode, ...]
577573

578574

@@ -584,7 +580,6 @@ class ObjectFieldNode(Node):
584580

585581

586582
class ConstObjectFieldNode(ObjectFieldNode):
587-
588583
value: ConstValueNode
589584

590585

@@ -611,7 +606,6 @@ class DirectiveNode(Node):
611606

612607

613608
class ConstDirectiveNode(DirectiveNode):
614-
615609
arguments: Tuple[ConstArgumentNode, ...]
616610

617611

src/graphql/language/visitor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,6 @@ def leave(node: Node, *args: Any) -> Optional[VisitorAction]:
364364
return None
365365

366366
else:
367-
368367
enter = leave = None
369368

370369
enter_leave = EnterLeaveVisitor(enter, leave)

src/graphql/type/definition.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,6 @@ def is_required_argument(arg: GraphQLArgument) -> bool:
652652

653653

654654
class GraphQLObjectTypeKwargs(GraphQLNamedTypeKwargs, total=False):
655-
656655
fields: GraphQLFieldMap
657656
interfaces: Tuple[GraphQLInterfaceType, ...]
658657
is_type_of: Optional[GraphQLIsTypeOfFn]
@@ -1128,7 +1127,6 @@ class GraphQLEnumValueKwargs(TypedDict, total=False):
11281127

11291128

11301129
class GraphQLEnumValue:
1131-
11321130
value: Any
11331131
description: Optional[str]
11341132
deprecation_reason: Optional[str]

src/graphql/type/schema.py

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

4848

4949
class InterfaceImplementations(NamedTuple):
50-
5150
objects: List[GraphQLObjectType]
5251
interfaces: List[GraphQLInterfaceType]
5352

src/graphql/type/validate.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def validate_schema(schema: GraphQLSchema) -> List[GraphQLError]:
5757
# noinspection PyProtectedMember
5858
errors = schema._validation_errors
5959
if errors is None:
60-
6160
# Validate the schema, producing a list of errors.
6261
context = SchemaValidationContext(schema)
6362
context.validate_root_types()
@@ -196,7 +195,6 @@ def validate_name(self, node: Any, name: Optional[str] = None) -> None:
196195
def validate_types(self) -> None:
197196
validate_input_object_circular_refs = InputObjectCircularRefsValidator(self)
198197
for type_ in self.schema.type_map.values():
199-
200198
# Ensure all provided types are in fact GraphQL type.
201199
if not is_named_type(type_):
202200
self.report_error(
@@ -247,7 +245,6 @@ def validate_fields(
247245
)
248246

249247
for field_name, field in fields.items():
250-
251248
# Ensure they are named correctly.
252249
self.validate_name(field, field_name)
253250

@@ -463,7 +460,6 @@ def validate_input_fields(self, input_obj: GraphQLInputObjectType) -> None:
463460

464461
# Ensure the arguments are valid
465462
for field_name, field in fields.items():
466-
467463
# Ensure they are named correctly.
468464
self.validate_name(field, field_name)
469465

src/graphql/utilities/find_breaking_changes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def find_directive_changes(
140140
)
141141
)
142142

143-
for (old_directive, new_directive) in directives_diff.persisted:
143+
for old_directive, new_directive in directives_diff.persisted:
144144
args_diff = dict_diff(old_directive.args, new_directive.args)
145145

146146
for arg_name, new_arg in args_diff.added.items():
@@ -506,7 +506,6 @@ def is_change_safe_for_input_object_field_or_field_arg(
506506
old_type: GraphQLType, new_type: GraphQLType
507507
) -> bool:
508508
if is_list_type(old_type):
509-
510509
return is_list_type(
511510
# if they're both lists, make sure underlying types are compatible
512511
new_type

src/graphql/validation/rules/provided_required_arguments.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ def leave_directive(self, directive_node: DirectiveNode, *_args: Any) -> None:
6060
directive_name = directive_node.name.value
6161
required_args = self.required_args_map.get(directive_name)
6262
if required_args:
63-
6463
arg_nodes = directive_node.arguments or ()
6564
arg_node_set = {arg.name.value for arg in arg_nodes}
6665
for arg_name in required_args:

0 commit comments

Comments
 (0)