⬆ Require Pydantic > 1.0 (#1862)

* 🔥 Remove support for Pydantic < 1.0

* 🔥 Remove deprecated skip_defaults from jsonable_encoder and set default for exclude to None, as in Pydantic

* ♻️ Set default of response_model_exclude=None as in Pydantic

* ⬆️ Require Pydantic >=1.0.0 in requirements
This commit is contained in:
Sebastián Ramírez authored and GitHub committed 2020-08-09 22:17:08 +02:00
1 parent 3390182fc9
commit e1758d107e
14 files changed
+115 -396

No files matched your search

+2 -13
View File
@@ -2,24 +2,13 @@ from enum import Enum
from typing import Any, Callable, Dict, Iterable, List, Optional, Union
from fastapi.logger import logger
from pydantic import BaseModel
try:
from pydantic import AnyUrl, Field
except ImportError: # pragma: nocover
# TODO: remove when removing support for Pydantic < 1.0.0
from pydantic import Schema as Field # type: ignore
from pydantic import UrlStr as AnyUrl # type: ignore
from pydantic import AnyUrl, BaseModel, Field
try:
import email_validator
assert email_validator # make autoflake ignore the unused import
try:
from pydantic import EmailStr
except ImportError: # pragma: nocover
# TODO: remove when removing support for Pydantic < 1.0.0
from pydantic.types import EmailStr # type: ignore
from pydantic import EmailStr
except ImportError: # pragma: no cover
class EmailStr(str): # type: ignore