Skip to content

Commit

Permalink
Fix import error for users who don't use pydantic
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnemec committed Aug 8, 2023
1 parent b456a70 commit ad2dbb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Release type: minor

Fix import error in `strawberry.ext.mypy_plugin` for users who don't use pydantic.
4 changes: 3 additions & 1 deletion strawberry/ext/mypy_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
)
from mypy.typevars import fill_typevars
from mypy.util import get_unique_redefinition_name
from strawberry.experimental.pydantic._compat import IS_PYDANTIC_V1

# Backwards compatible with the removal of `TypeVarDef` in mypy 0.920.
try:
Expand All @@ -64,8 +63,11 @@
try:
from pydantic.mypy import METADATA_KEY as PYDANTIC_METADATA_KEY
from pydantic.mypy import PydanticModelField

from strawberry.experimental.pydantic._compat import IS_PYDANTIC_V1
except ImportError:
PYDANTIC_METADATA_KEY = ""
IS_PYDANTIC_V1 = False


if TYPE_CHECKING:
Expand Down

0 comments on commit ad2dbb8

Please sign in to comment.