Skip to content

Commit

Permalink
remove compat file
Browse files Browse the repository at this point in the history
  • Loading branch information
thejaminator committed Jun 25, 2023
1 parent 2103eab commit 064db83
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 22 deletions.
13 changes: 0 additions & 13 deletions strawberry/experimental/pydantic/v2_compat.py

This file was deleted.

2 changes: 1 addition & 1 deletion strawberry/experimental/pydantic2/error_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
)

from pydantic import BaseModel
from pydantic._internal._utils import lenient_issubclass

from strawberry.auto import StrawberryAuto
from strawberry.experimental.pydantic2.utils import (
get_private_fields,
get_strawberry_type_from_model,
normalize_type,
)
from strawberry.experimental.pydantic2.v2_compat import lenient_issubclass
from strawberry.object_type import _process_type, _wrap_dataclass
from strawberry.types.type_resolver import _get_fields
from strawberry.utils.typing import get_list_annotation, is_list
Expand Down
14 changes: 7 additions & 7 deletions strawberry/experimental/pydantic2/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@

import pydantic
from pydantic import BaseModel
from pydantic._internal._typing_extra import is_new_type
from pydantic._internal._utils import lenient_issubclass
from typing_extensions import get_args, get_origin

from strawberry.experimental.pydantic2.exceptions import (
UnregisteredTypeException,
UnsupportedTypeError,
)
from strawberry.experimental.pydantic2.v2_compat import (
get_args,
get_origin,
is_new_type,
lenient_issubclass,
new_type_supertype,
)
from strawberry.types.types import TypeDefinition

try:
Expand All @@ -39,6 +35,10 @@
}


def new_type_supertype(type_):
return type_.__supertype__


def get_basic_type(type_: Any) -> Type[Any]:
# if lenient_issubclass(type_, pydantic.ConstrainedInt):
# if lenient_issubclass(type_, pydantic.ConstrainedFloat):
Expand Down
1 change: 0 additions & 1 deletion strawberry/experimental/pydantic2/v2_compat.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pydantic

if pydantic.VERSION[0] == "2":

from pydantic._internal._utils import lenient_issubclass, smart_deepcopy

def new_type_supertype(type_):
Expand Down

0 comments on commit 064db83

Please sign in to comment.