|
|
|
@ -23,7 +23,7 @@ from pydantic import PydanticSchemaGenerationError as PydanticSchemaGenerationEr |
|
|
|
from pydantic import PydanticUndefinedAnnotation as PydanticUndefinedAnnotation |
|
|
|
from pydantic import ValidationError as ValidationError |
|
|
|
from pydantic._internal import _typing_extra as _pydantic_typing_extra |
|
|
|
from pydantic._internal._schema_generation_shared import ( # type: ignore[attr-defined] |
|
|
|
from pydantic._internal._schema_generation_shared import ( # type: ignore[attr-defined] # ty: ignore[unused-ignore-comment] |
|
|
|
GetJsonSchemaHandler as GetJsonSchemaHandler, |
|
|
|
) |
|
|
|
from pydantic.fields import FieldInfo as FieldInfo |
|
|
|
@ -39,21 +39,13 @@ from pydantic_core.core_schema import ( |
|
|
|
RequiredParam = PydanticUndefined |
|
|
|
Undefined = PydanticUndefined |
|
|
|
|
|
|
|
# pydantic.color.Color is deprecated since v2.0b3 |
|
|
|
try: |
|
|
|
from pydantic_extra_types.color import Color |
|
|
|
except ImportError: # pragma: no cover |
|
|
|
from pydantic.color import ( # type: ignore[assignment] |
|
|
|
Color, # noqa: F401 |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
def define_forwardref() -> Callable[..., Any]: |
|
|
|
# eval_type_lenient has been deprecated since Pydantic v2.10.0b1 (PR #10530) |
|
|
|
try_eval_type = getattr(_pydantic_typing_extra, "try_eval_type", None) |
|
|
|
if try_eval_type is not None: |
|
|
|
return lambda *args: try_eval_type(*args)[0] |
|
|
|
return _pydantic_typing_extra.eval_type_lenient # pragma: no cover |
|
|
|
return _pydantic_typing_extra.eval_type_lenient # pragma: no cover # ty: ignore[deprecated] |
|
|
|
|
|
|
|
|
|
|
|
evaluate_forwardref = define_forwardref() |
|
|
|
|