Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 9, 2024
1 parent ea6321e commit 73865f2
Show file tree
Hide file tree
Showing 47 changed files with 148 additions and 148 deletions.
16 changes: 8 additions & 8 deletions strawberry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,32 @@
from .types.unset import UNSET

__all__ = [
"BasePermission",
"experimental",
"ID",
"Info",
"UNSET",
"lazy",
"BasePermission",
"Info",
"LazyType",
"Parent",
"Private",
"Schema",
"argument",
"asdict",
"auto",
"directive",
"directive_field",
"schema_directive",
"enum",
"enum_value",
"experimental",
"federation",
"field",
"input",
"interface",
"lazy",
"mutation",
"relay",
"scalar",
"schema_directive",
"subscription",
"type",
"union",
"auto",
"asdict",
"relay",
]
2 changes: 1 addition & 1 deletion strawberry/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@


class StrawberryAnnotation:
__slots__ = "raw_annotation", "namespace", "__resolve_cache__"
__slots__ = "__resolve_cache__", "namespace", "raw_annotation"

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion strawberry/channels/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
__all__ = [
"ChannelsConsumer",
"ChannelsRequest",
"GraphQLProtocolTypeRouter",
"GraphQLHTTPConsumer",
"GraphQLProtocolTypeRouter",
"GraphQLWSConsumer",
"SyncGraphQLHTTPConsumer",
]
2 changes: 1 addition & 1 deletion strawberry/cli/commands/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import functools
import importlib
import inspect
from pathlib import Path # noqa: TCH003
from pathlib import Path # noqa: TC003
from typing import List, Optional, Type, Union, cast

import rich
Expand Down
2 changes: 1 addition & 1 deletion strawberry/cli/commands/upgrade/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import glob
import pathlib # noqa: TCH003
import pathlib # noqa: TC003
import sys
from typing import List

Expand Down
4 changes: 2 additions & 2 deletions strawberry/codegen/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MultipleOperationsProvidedError(CodegenError):

__all__ = [
"CodegenError",
"NoOperationProvidedError",
"NoOperationNameProvidedError",
"MultipleOperationsProvidedError",
"NoOperationNameProvidedError",
"NoOperationProvidedError",
]
6 changes: 3 additions & 3 deletions strawberry/codegen/query_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,9 +922,9 @@ def _collect_enum(self, enum: EnumDefinition) -> GraphQLEnum:


__all__ = [
"QueryCodegen",
"QueryCodegenPlugin",
"ConsolePlugin",
"CodegenFile",
"CodegenResult",
"ConsolePlugin",
"QueryCodegen",
"QueryCodegenPlugin",
]
38 changes: 19 additions & 19 deletions strawberry/codegen/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,31 +197,31 @@ class GraphQLOperation:


__all__ = [
"GraphQLOptional",
"GraphQLList",
"GraphQLUnion",
"GraphQLArgument",
"GraphQLArgumentValue",
"GraphQLBoolValue",
"GraphQLDirective",
"GraphQLEnum",
"GraphQLEnumValue",
"GraphQLField",
"GraphQLFieldSelection",
"GraphQLFloatValue",
"GraphQLFragmentSpread",
"GraphQLObjectType",
"GraphQLFragmentType",
"GraphQLEnum",
"GraphQLScalar",
"GraphQLType",
"GraphQLFieldSelection",
"GraphQLInlineFragment",
"GraphQLSelection",
"GraphQLStringValue",
"GraphQLIntValue",
"GraphQLFloatValue",
"GraphQLEnumValue",
"GraphQLBoolValue",
"GraphQLNullValue",
"GraphQLList",
"GraphQLListValue",
"GraphQLNullValue",
"GraphQLObjectType",
"GraphQLObjectValue",
"GraphQLVariableReference",
"GraphQLArgumentValue",
"GraphQLArgument",
"GraphQLDirective",
"GraphQLVariable",
"GraphQLOperation",
"GraphQLOptional",
"GraphQLScalar",
"GraphQLSelection",
"GraphQLStringValue",
"GraphQLType",
"GraphQLUnion",
"GraphQLVariable",
"GraphQLVariableReference",
]
2 changes: 1 addition & 1 deletion strawberry/codemods/annotated_unions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import libcst as cst
import libcst.matchers as m
from libcst._nodes.expression import BaseExpression, Call # noqa: TCH002
from libcst._nodes.expression import BaseExpression, Call # noqa: TC002
from libcst.codemod import CodemodContext, VisitorBasedCodemodCommand
from libcst.codemod.visitors import AddImportsVisitor, RemoveImportsVisitor

Expand Down
14 changes: 7 additions & 7 deletions strawberry/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ def prime_many(self, data: Mapping[K, T], force: bool = False) -> None:
def should_create_new_batch(loader: DataLoader, batch: Batch) -> bool:
return bool(
batch.dispatched
or loader.max_batch_size
and len(batch) >= loader.max_batch_size
or (loader.max_batch_size
and len(batch) >= loader.max_batch_size)
)


Expand Down Expand Up @@ -267,13 +267,13 @@ async def dispatch_batch(loader: DataLoader, batch: Batch) -> None:


__all__ = [
"DataLoader",
"Batch",
"LoaderTask",
"AbstractCache",
"Batch",
"DataLoader",
"DefaultCache",
"should_create_new_batch",
"get_current_batch",
"LoaderTask",
"dispatch",
"dispatch_batch",
"get_current_batch",
"should_create_new_batch",
]
2 changes: 1 addition & 1 deletion strawberry/django/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,4 @@ async def create_websocket_response(
raise NotImplementedError


__all__ = ["GraphQLView", "AsyncGraphQLView"]
__all__ = ["AsyncGraphQLView", "GraphQLView"]
42 changes: 21 additions & 21 deletions strawberry/exceptions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,32 +158,32 @@ class StrawberryGraphQLError(GraphQLError):


__all__ = [
"StrawberryException",
"UnableToFindExceptionSource",
"ConflictingArgumentsError",
"DuplicatedTypeName",
"FieldWithResolverAndDefaultFactoryError",
"FieldWithResolverAndDefaultValueError",
"InvalidArgumentTypeError",
"InvalidCustomContext",
"InvalidDefaultFactoryError",
"InvalidTypeForUnionMergeError",
"InvalidUnionTypeError",
"MissingArgumentsAnnotationsError",
"MissingFieldAnnotationError",
"MissingOptionalDependenciesError",
"MissingQueryError",
"MissingReturnAnnotationError",
"WrongReturnTypeForUnion",
"UnallowedReturnTypeForUnion",
"MissingTypesForGenericError",
"MultipleStrawberryArgumentsError",
"ObjectIsNotAnEnumError",
"ObjectIsNotClassError",
"InvalidUnionTypeError",
"InvalidTypeForUnionMergeError",
"MissingTypesForGenericError",
"UnsupportedTypeError",
"UnresolvedFieldTypeError",
"PrivateStrawberryFieldError",
"MultipleStrawberryArgumentsError",
"ScalarAlreadyRegisteredError",
"WrongNumberOfResultsReturned",
"FieldWithResolverAndDefaultValueError",
"FieldWithResolverAndDefaultFactoryError",
"ConflictingArgumentsError",
"MissingQueryError",
"InvalidArgumentTypeError",
"InvalidDefaultFactoryError",
"InvalidCustomContext",
"MissingFieldAnnotationError",
"DuplicatedTypeName",
"StrawberryException",
"StrawberryGraphQLError",
"MissingOptionalDependenciesError",
"UnableToFindExceptionSource",
"UnallowedReturnTypeForUnion",
"UnresolvedFieldTypeError",
"UnsupportedTypeError",
"WrongNumberOfResultsReturned",
"WrongReturnTypeForUnion",
]
4 changes: 2 additions & 2 deletions strawberry/experimental/pydantic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from .object_type import input, interface, type

__all__ = [
"error_type",
"UnregisteredTypeException",
"error_type",
"input",
"type",
"interface",
"type",
]
4 changes: 2 additions & 2 deletions strawberry/experimental/pydantic/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@ def new_type_supertype(type_: Any) -> Any:

__all__ = [
"PydanticCompat",
"get_args",
"get_origin",
"is_new_type",
"lenient_issubclass",
"get_origin",
"get_args",
"new_type_supertype",
"smart_deepcopy",
]
12 changes: 6 additions & 6 deletions strawberry/extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ def __getattr__(name: str) -> Type[SchemaExtension]:


__all__ = [
"FieldExtension",
"SchemaExtension",
"LifecycleStep",
"AddValidationRules",
"DisableValidation",
"ParserCache",
"QueryDepthLimiter",
"FieldExtension",
"IgnoreContext",
"ValidationCache",
"LifecycleStep",
"MaskErrors",
"MaxAliasesLimiter",
"MaxTokensLimiter",
"ParserCache",
"QueryDepthLimiter",
"SchemaExtension",
"ValidationCache",
]
2 changes: 1 addition & 1 deletion strawberry/extensions/base_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ def _implements_resolve(cls) -> bool:
SchemaExtension.on_execute.__name__,
}

__all__ = ["SchemaExtension", "Hook", "HOOK_METHODS", "LifecycleStep"]
__all__ = ["HOOK_METHODS", "Hook", "LifecycleStep", "SchemaExtension"]
6 changes: 3 additions & 3 deletions strawberry/extensions/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class WrappedHook(NamedTuple):

class ExtensionContextManagerBase:
__slots__ = (
"hooks",
"deprecation_message",
"default_hook",
"async_exit_stack",
"default_hook",
"deprecation_message",
"exit_stack",
"hooks",
)

def __init_subclass__(cls) -> None:
Expand Down
2 changes: 1 addition & 1 deletion strawberry/extensions/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ def get_path_from_info(info: GraphQLResolveInfo) -> List[str]:
return elements[::-1]


__all__ = ["is_introspection_key", "is_introspection_field", "get_path_from_info"]
__all__ = ["get_path_from_info", "is_introspection_field", "is_introspection_key"]
2 changes: 1 addition & 1 deletion strawberry/fastapi/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from typing_extensions import TypeGuard

from starlette import status
from starlette.background import BackgroundTasks # noqa: TCH002
from starlette.background import BackgroundTasks # noqa: TC002
from starlette.requests import HTTPConnection, Request
from starlette.responses import (
HTMLResponse,
Expand Down
6 changes: 3 additions & 3 deletions strawberry/federation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
from .union import union

__all__ = [
"Schema",
"argument",
"enum",
"enum_value",
"field",
"mutation",
"input",
"interface",
"interface_object",
"type",
"mutation",
"scalar",
"Schema",
"schema_directive",
"type",
"union",
]
2 changes: 1 addition & 1 deletion strawberry/federation/object_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,4 +371,4 @@ def interface_object(
)


__all__ = ["type", "input", "interface", "interface_object"]
__all__ = ["input", "interface", "interface_object", "type"]
18 changes: 9 additions & 9 deletions strawberry/federation/schema_directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,18 +229,18 @@ class Policy(FederationDirective):


__all__ = [
"Authenticated",
"ComposeDirective",
"External",
"Requires",
"Provides",
"Inaccessible",
"InterfaceObject",
"Key",
"Shareable",
"Link",
"Tag",
"Override",
"Inaccessible",
"ComposeDirective",
"InterfaceObject",
"Authenticated",
"RequiresScopes",
"Policy",
"Provides",
"Requires",
"RequiresScopes",
"Shareable",
"Tag",
]
2 changes: 1 addition & 1 deletion strawberry/flask/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,6 @@ async def create_websocket_response(


__all__ = [
"GraphQLView",
"AsyncGraphQLView",
"GraphQLView",
]
Loading

0 comments on commit 73865f2

Please sign in to comment.