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 3, 2023
1 parent a4bc9ae commit 11d5e4f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 35 deletions.
1 change: 0 additions & 1 deletion strawberry/experimental/pydantic/object_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
from strawberry.types.type_resolver import _get_fields
from strawberry.utils.dataclasses import add_custom_init_fn


if TYPE_CHECKING:
from graphql import GraphQLResolveInfo

Expand Down
16 changes: 6 additions & 10 deletions strawberry/experimental/pydantic/pydantic_first_class.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
import dataclasses
from typing import Callable, Dict, List, Optional, Sequence, Type

from pydantic import BaseModel

from strawberry.annotation import StrawberryAnnotation
from strawberry.experimental.pydantic._compat import CompatModelField, get_model_fields
from strawberry.experimental.pydantic.conversion_types import PydanticModel
from strawberry.experimental.pydantic.fields import replace_types_recursively
from strawberry.experimental.pydantic.utils import get_default_factory_for_field
from strawberry.field import StrawberryField


from pydantic import BaseModel


import dataclasses
from typing import Callable, Dict, List, Optional, Sequence, Type

from strawberry.object_type import _get_interfaces
from strawberry.types.types import StrawberryObjectDefinition
from strawberry.utils.deprecations import DEPRECATION_MESSAGES, DeprecatedDescriptor
from strawberry.utils.str_converters import to_camel_case

from strawberry.experimental.pydantic.conversion_types import PydanticModel


def _get_strawberry_fields_from_basemodel(
model: Type[BaseModel], is_input: bool, use_pydantic_alias: bool
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
from typing import Dict, List, Union
from graphql import is_valid_name_error

import pydantic
import pytest

import strawberry
from strawberry.experimental.pydantic._compat import IS_PYDANTIC_V2

from strawberry.experimental.pydantic.pydantic_first_class import first_class


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
import textwrap
from enum import Enum
from typing import List, Optional, Union
Expand All @@ -7,12 +6,8 @@
import pytest

import strawberry
from tests.experimental.pydantic.utils import needs_pydantic_v1

from strawberry.experimental.pydantic.pydantic_first_class import first_class

from strawberry.schema.config import StrawberryConfig


def test_basic_type_field_list():
@first_class()
Expand Down
20 changes: 3 additions & 17 deletions tests/experimental/pydantic_first_class/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,20 @@
import dataclasses
import sys
import textwrap
from enum import Enum
from typing import Annotated, Any, List, Optional, Union
from graphql import is_input_type

import pydantic
import pytest

import strawberry
from tests.experimental.pydantic.utils import needs_pydantic_v1

from strawberry.enum import EnumDefinition
from strawberry.experimental.pydantic.pydantic_first_class import (
first_class,
)

from strawberry.types.types import StrawberryObjectDefinition

from strawberry.schema_directive import Location
from strawberry.type import StrawberryList, StrawberryOptional

from strawberry.experimental.pydantic.exceptions import MissingFieldsListError

from strawberry.types.types import StrawberryObjectDefinition
from strawberry.union import StrawberryUnion

from strawberry.enum import EnumDefinition

from strawberry.schema_directive import Location

from strawberry.experimental.pydantic.pydantic_first_class import register_first_class


def test_basic_type_field_list():
@first_class()
Expand Down

0 comments on commit 11d5e4f

Please sign in to comment.