Skip to content

Commit 42c04e8

Browse files
Merge pull request #11 from Adori/yy-pydantic-v2
Support for Pydantic v2
2 parents c321a13 + e9638f8 commit 42c04e8

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
- id: isort
66
args: [--force-single-line-imports]
77
- repo: https://github.com/psf/black
8-
rev: 21.12b0
8+
rev: 22.3.0
99
hooks:
1010
- id: black
1111
- repo: https://gitlab.com/pycqa/flake8

examples/full/serializer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Third Party Imports
2-
from pydantic import BaseModel
2+
from pydantic.v1 import BaseModel
33

44

55
class Payload(BaseModel):

examples/simple/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Third Party Imports
66
from fastapi import FastAPI
77
from fastapi.routing import APIRouter
8-
from pydantic import BaseModel
8+
from pydantic.v1 import BaseModel
99

1010
# Imports from this repository
1111
from fastapi_cloud_tasks import DelayedRouteBuilder

fastapi_cloud_tasks/exception.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Third Party Imports
2-
from pydantic.errors import MissingError
3-
from pydantic.errors import PydanticValueError
2+
from pydantic.v1.errors import MissingError
3+
from pydantic.v1.errors import PydanticValueError
44

55

66
class MissingParamError(MissingError):

fastapi_cloud_tasks/requester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from fastapi.dependencies.utils import request_params_to_args
1212
from fastapi.encoders import jsonable_encoder
1313
from fastapi.routing import APIRoute
14-
from pydantic.error_wrappers import ErrorWrapper
14+
from pydantic.v1.error_wrappers import ErrorWrapper
1515

1616
# Imports from this repository
1717
from fastapi_cloud_tasks.exception import MissingParamError

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
google-cloud-tasks==2.7.0
22
google-cloud-scheduler==2.5.0
3-
fastapi==0.70.0
3+
fastapi==0.100.0

0 commit comments

Comments
 (0)