update pydantic 1.10.16
This commit is contained in:
parent
8dd91e1c57
commit
893076582d
@ -1,61 +0,0 @@
|
|||||||
pydantic-1.10.14.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
|
||||||
pydantic-1.10.14.dist-info/LICENSE,sha256=njlGaQrIi2tz6PABoFhq8TVovohS_VFOQ5Pzl2F2Q4c,1127
|
|
||||||
pydantic-1.10.14.dist-info/METADATA,sha256=lYLXr7lOF7BMRkokRnhTeJODH7dv_zlYVTKfw6M_rNg,150189
|
|
||||||
pydantic-1.10.14.dist-info/RECORD,,
|
|
||||||
pydantic-1.10.14.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
||||||
pydantic-1.10.14.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
|
||||||
pydantic-1.10.14.dist-info/entry_points.txt,sha256=EquH5n3pilIXg-LLa1K4evpu5-6dnvxzi6vwvkoAMns,45
|
|
||||||
pydantic-1.10.14.dist-info/top_level.txt,sha256=cmo_5n0F_YY5td5nPZBfdjBENkmGg_pE5ShWXYbXxTM,9
|
|
||||||
pydantic/__init__.py,sha256=iTu8CwWWvn6zM_zYJtqhie24PImW25zokitz_06kDYw,2771
|
|
||||||
pydantic/__pycache__/__init__.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/_hypothesis_plugin.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/annotated_types.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/class_validators.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/color.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/config.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/dataclasses.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/datetime_parse.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/decorator.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/env_settings.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/error_wrappers.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/errors.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/fields.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/generics.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/json.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/main.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/mypy.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/networks.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/parse.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/schema.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/tools.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/types.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/typing.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/utils.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/validators.cpython-38.pyc,,
|
|
||||||
pydantic/__pycache__/version.cpython-38.pyc,,
|
|
||||||
pydantic/_hypothesis_plugin.py,sha256=gILcyAEfZ3u9YfKxtDxkReLpakjMou1VWC3FEcXmJgQ,14844
|
|
||||||
pydantic/annotated_types.py,sha256=dJTDUyPj4QJj4rDcNkt9xDUMGEkAnuWzDeGE2q7Wxrc,3124
|
|
||||||
pydantic/class_validators.py,sha256=0BZx0Ft19cREVHEOaA6wf_E3A0bTL4wQIGzeOinVatg,14595
|
|
||||||
pydantic/color.py,sha256=cGzck7kSD5beBkOMhda4bfTICput6dMx8GGpEU5SK5Y,16811
|
|
||||||
pydantic/config.py,sha256=h5ceeZ9HzDjUv0IZNYQoza0aNGFVo22iszY-6s0a3eM,6477
|
|
||||||
pydantic/dataclasses.py,sha256=dO6Slbjc6_PZKi2ZFhDkcmCL1VSPoX44sV-2FBIajRQ,18073
|
|
||||||
pydantic/datetime_parse.py,sha256=DhGfkbG4Vs5Oyxq3u8jM-7gFrbuUKsn-4aG2DJDJbHw,7714
|
|
||||||
pydantic/decorator.py,sha256=wzuIuKKHVjaiE97YBctCU0Vho0VRlUO-aVu1IUEczFE,10263
|
|
||||||
pydantic/env_settings.py,sha256=4PWxPYeK5jt59JJ4QGb90qU8pfC7qgGX44UESTmXdpE,14039
|
|
||||||
pydantic/error_wrappers.py,sha256=xm128iOK5r0-P-oP0XWq2EqMEfEyjhQlj2aBpECytNc,5141
|
|
||||||
pydantic/errors.py,sha256=f93z30S4s5bJEl8JXh-zFCAtLDCko9ze2hKTkOimaa8,17693
|
|
||||||
pydantic/fields.py,sha256=vNZItUcuW6kBhQNQW7wA4LgiZiza4dT2Q6Dx4QvoSgE,50485
|
|
||||||
pydantic/generics.py,sha256=n5TTgh3EHkG1Xw3eY9A143bUN11_4m57Db5u49hkGJ8,17805
|
|
||||||
pydantic/json.py,sha256=B0gJ2WmPqw-6fsvPmgu-rwhhOy4E0JpbbYjC8HR01Ho,3346
|
|
||||||
pydantic/main.py,sha256=5dcT68MxbI3WguS194pyQYUGXb3a3Ukxnq2jzoi_SXg,44376
|
|
||||||
pydantic/mypy.py,sha256=G8yQLLt6CodoTvGl84MP3ZpdInBtc0QoaLJ7iArHXNU,38745
|
|
||||||
pydantic/networks.py,sha256=TeV9FvCYg4ALk8j7dU1q6Ntze7yaUrCHQFEDJDnq1NI,22059
|
|
||||||
pydantic/parse.py,sha256=rrVhaWLK8t03rT3oxvC6uRLuTF5iZ2NKGvGqs4iQEM0,1810
|
|
||||||
pydantic/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
||||||
pydantic/schema.py,sha256=hj0y0U-ooqNnB6kBWg_ybZXOBIjAhI4PgucQYU0MVIc,47614
|
|
||||||
pydantic/tools.py,sha256=ELC66w6UaU_HzAGfJBSIP47Aq9ZGkGiWPMLkkTs6VrI,2826
|
|
||||||
pydantic/types.py,sha256=cjZCEd0AjkJcwmDKOP6DlAjQn4aGyBVZHBVWBKt0jI0,35379
|
|
||||||
pydantic/typing.py,sha256=5_C_fiUvWiAzW3MBJaHeuy2s3Hi52rFMxTfNPHv9_os,18996
|
|
||||||
pydantic/utils.py,sha256=5w7Q3N_Fqg5H9__JQDaumw9N3EFdlc7galEsCGxEDN0,25809
|
|
||||||
pydantic/validators.py,sha256=T-t9y9L_68El9p4PYkEVGEjpetNV6luav8Iwu9iTLkM,21887
|
|
||||||
pydantic/version.py,sha256=pzxJyMSk4aNDW_Gm_GQELKTS5FxVzKC81LqictLj1ZM,1039
|
|
@ -1,6 +1,6 @@
|
|||||||
Metadata-Version: 2.1
|
Metadata-Version: 2.1
|
||||||
Name: pydantic
|
Name: pydantic
|
||||||
Version: 1.10.14
|
Version: 1.10.16
|
||||||
Summary: Data validation and settings management using python type hints
|
Summary: Data validation and settings management using python type hints
|
||||||
Home-page: https://github.com/pydantic/pydantic
|
Home-page: https://github.com/pydantic/pydantic
|
||||||
Author: Samuel Colvin
|
Author: Samuel Colvin
|
||||||
@ -30,11 +30,11 @@ Classifier: Topic :: Internet
|
|||||||
Requires-Python: >=3.7
|
Requires-Python: >=3.7
|
||||||
Description-Content-Type: text/markdown
|
Description-Content-Type: text/markdown
|
||||||
License-File: LICENSE
|
License-File: LICENSE
|
||||||
Requires-Dist: typing-extensions>=4.2.0
|
Requires-Dist: typing-extensions >=4.2.0
|
||||||
Provides-Extra: dotenv
|
Provides-Extra: dotenv
|
||||||
Requires-Dist: python-dotenv>=0.10.4; extra == "dotenv"
|
Requires-Dist: python-dotenv >=0.10.4 ; extra == 'dotenv'
|
||||||
Provides-Extra: email
|
Provides-Extra: email
|
||||||
Requires-Dist: email-validator>=1.0.3; extra == "email"
|
Requires-Dist: email-validator >=1.0.3 ; extra == 'email'
|
||||||
|
|
||||||
# pydantic
|
# pydantic
|
||||||
|
|
||||||
@ -98,6 +98,18 @@ contribution to *pydantic*, see
|
|||||||
See our [security policy](https://github.com/pydantic/pydantic/security/policy).
|
See our [security policy](https://github.com/pydantic/pydantic/security/policy).
|
||||||
|
|
||||||
|
|
||||||
|
## v1.10.16 (2024-06-11)
|
||||||
|
|
||||||
|
* Specify recursive_guard as kwarg in FutureRef._evaluate by [@vfazio](https://github.com/vfazio) in https://github.com/pydantic/pydantic/pull/#961
|
||||||
|
* Fix mypy v1 plugin for upcoming mypy release by @ cdce8p in https://github.com/pydantic/pydantic/pull/9586
|
||||||
|
* Import modules/objects directly from v1 namespace by [@exs-dwoodward](https://github.com/exs-dwoodward) in https://github.com/pydantic/pydantic/pull/9162
|
||||||
|
|
||||||
|
## v1.10.15 (2024-04-03)
|
||||||
|
|
||||||
|
* Add pydantic.v1 namespace to Pydantic v1 by [@exs-dmiketa](https://github.com/exs-dmiketa) in https://github.com/pydantic/pydantic/pull/9042
|
||||||
|
* Relax version of typing-extensions for V1 by [@SonOfLilit](https://github.com/SonOfLilit) in https://github.com/pydantic/pydantic/pull/8819
|
||||||
|
* patch fix for mypy by [@sydney-runkle](https://github.com/sydney-runkle) in https://github.com/pydantic/pydantic/pull/8765
|
||||||
|
|
||||||
## v1.10.14 (2024-01-19)
|
## v1.10.14 (2024-01-19)
|
||||||
|
|
||||||
* Update install.md by [@dmontagu](https://github.com/dmontagu) in https://github.com/pydantic/pydantic/pull/7690
|
* Update install.md by [@dmontagu](https://github.com/dmontagu) in https://github.com/pydantic/pydantic/pull/7690
|
63
site-packages/pydantic-1.10.16.dist-info/RECORD
Normal file
63
site-packages/pydantic-1.10.16.dist-info/RECORD
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
pydantic-1.10.16.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||||
|
pydantic-1.10.16.dist-info/LICENSE,sha256=njlGaQrIi2tz6PABoFhq8TVovohS_VFOQ5Pzl2F2Q4c,1127
|
||||||
|
pydantic-1.10.16.dist-info/METADATA,sha256=heGOr2oDDNuf4s6BaBgy8DfMqEHUmpFsA8SZdG0ssEo,151071
|
||||||
|
pydantic-1.10.16.dist-info/RECORD,,
|
||||||
|
pydantic-1.10.16.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||||
|
pydantic-1.10.16.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
||||||
|
pydantic-1.10.16.dist-info/entry_points.txt,sha256=EquH5n3pilIXg-LLa1K4evpu5-6dnvxzi6vwvkoAMns,45
|
||||||
|
pydantic-1.10.16.dist-info/top_level.txt,sha256=cmo_5n0F_YY5td5nPZBfdjBENkmGg_pE5ShWXYbXxTM,9
|
||||||
|
pydantic/__init__.py,sha256=TeIqU1PmJdMH0ztvKf781k_e0ziVkpDNMD6Rx1BAPi0,2898
|
||||||
|
pydantic/__pycache__/__init__.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/_hypothesis_plugin.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/annotated_types.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/class_validators.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/color.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/config.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/dataclasses.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/datetime_parse.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/decorator.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/env_settings.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/error_wrappers.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/errors.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/fields.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/generics.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/json.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/main.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/mypy.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/networks.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/parse.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/schema.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/tools.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/types.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/typing.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/utils.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/v1.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/validators.cpython-312.pyc,,
|
||||||
|
pydantic/__pycache__/version.cpython-312.pyc,,
|
||||||
|
pydantic/_hypothesis_plugin.py,sha256=gILcyAEfZ3u9YfKxtDxkReLpakjMou1VWC3FEcXmJgQ,14844
|
||||||
|
pydantic/annotated_types.py,sha256=BfEVx8bdMUFK-AlO-LU-fxt2I_7xQwNA_fl-mbuNrbM,3148
|
||||||
|
pydantic/class_validators.py,sha256=JumZvw-ZPc_EQZAK_qqtgTzz1pcWVShBYM8ghDXpIHA,14651
|
||||||
|
pydantic/color.py,sha256=AlQ4wBEgeU8-Va-5pV_FObl5lA7r579EF-MHt-nkphI,16835
|
||||||
|
pydantic/config.py,sha256=1-fak1i6rfrY7iuFC-JcXuC2BkJ5M8v6u62k8BsmZrM,6517
|
||||||
|
pydantic/dataclasses.py,sha256=_zFFUJIx1hlaI0CT151gzKzjbPFi0gd8adb9POFtWvA,18145
|
||||||
|
pydantic/datetime_parse.py,sha256=abJc-x71ik-Gz6ofbePDE2zmdgqGTTblStb8U_-s9SU,7721
|
||||||
|
pydantic/decorator.py,sha256=OuGBAGeL-HYXis2hXKw9dgcks-ZwuttNRMl7hkt8Pbk,10318
|
||||||
|
pydantic/env_settings.py,sha256=_haBeW4mDyciRenUt4L71vcWevkN68bVgzW7HcSDvr8,14087
|
||||||
|
pydantic/error_wrappers.py,sha256=HPT2e25KJyMF3qm0nhPUmlso166_OcHxj32NR_rRtII,5181
|
||||||
|
pydantic/errors.py,sha256=eCC88uVOeX1TacrjDAcpcZd8nxmpLWaTAK9LImWhx6o,17717
|
||||||
|
pydantic/fields.py,sha256=dOeDmaUxRVywbD8_BBLEsJFPP3HN-mNNdOoHwDPECF0,50604
|
||||||
|
pydantic/generics.py,sha256=bMBu8urVkYq_MwCjqHA6TPLG1qIe6MoMZZ4zX8FBpFU,17853
|
||||||
|
pydantic/json.py,sha256=Ia86XPrskWFxCl6Bp9KvKXY56nl3COOPABUuu9bFLKU,3378
|
||||||
|
pydantic/main.py,sha256=PMkIaXPUPNcju_nNRoDutDvEToMwM0L02K5ypp1jTns,44496
|
||||||
|
pydantic/mypy.py,sha256=hh_d645pOfcKDeWbuvM10wlEn33aK-wjHcJxRE7sHCs,38771
|
||||||
|
pydantic/networks.py,sha256=VZFhVZWDeaC71kufxBYQExSuTVQxjSjXFJAzBMAU1QU,22106
|
||||||
|
pydantic/parse.py,sha256=t09djjmx7CLALG8lg83hAonV6qbRwhIP8PSSzxULZKk,1818
|
||||||
|
pydantic/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||||
|
pydantic/schema.py,sha256=YoReTBcnhzEz6fRj4gQOGHPDfdc65c-X_PtCaV2US3k,47710
|
||||||
|
pydantic/tools.py,sha256=GNOURtVeWh0RbashriXadzh6G6NQOjvhCKdaoepmV5E,2866
|
||||||
|
pydantic/types.py,sha256=9nrl-YFHkW6iE8PtteQFWFSmz2pJvsT38poNLSgwPpM,35434
|
||||||
|
pydantic/typing.py,sha256=OmORFCDRBjBxJoHomOSvNZlIo6Mv4CoL8VK58XzJUDM,19234
|
||||||
|
pydantic/utils.py,sha256=oXx5P7NRQllgZdoXorFLFh8qij0yKVwiQejUznA5rGI,25889
|
||||||
|
pydantic/v1.py,sha256=mUdulX-fZ4Kb1URsHRaQLzSSq0beVkL7NuPutO2wftk,2674
|
||||||
|
pydantic/validators.py,sha256=9N-zeBytOIWUcTqT5aJnNZuwCERmab_5QGLYfKnmFAU,21966
|
||||||
|
pydantic/version.py,sha256=XJgzOxlJwdKTl32VGaCDtaOBUeG52t2R3Hmqa4bXNkM,1039
|
@ -1,5 +1,5 @@
|
|||||||
Wheel-Version: 1.0
|
Wheel-Version: 1.0
|
||||||
Generator: setuptools (74.1.2)
|
Generator: bdist_wheel (0.43.0)
|
||||||
Root-Is-Purelib: true
|
Root-Is-Purelib: true
|
||||||
Tag: py3-none-any
|
Tag: py3-none-any
|
||||||
|
|
@ -1,23 +1,23 @@
|
|||||||
# flake8: noqa
|
# flake8: noqa
|
||||||
from . import dataclasses
|
from pydantic import dataclasses
|
||||||
from .annotated_types import create_model_from_namedtuple, create_model_from_typeddict
|
from pydantic.annotated_types import create_model_from_namedtuple, create_model_from_typeddict
|
||||||
from .class_validators import root_validator, validator
|
from pydantic.class_validators import root_validator, validator
|
||||||
from .config import BaseConfig, ConfigDict, Extra
|
from pydantic.config import BaseConfig, ConfigDict, Extra
|
||||||
from .decorator import validate_arguments
|
from pydantic.decorator import validate_arguments
|
||||||
from .env_settings import BaseSettings
|
from pydantic.env_settings import BaseSettings
|
||||||
from .error_wrappers import ValidationError
|
from pydantic.error_wrappers import ValidationError
|
||||||
from .errors import *
|
from pydantic.errors import *
|
||||||
from .fields import Field, PrivateAttr, Required
|
from pydantic.fields import Field, PrivateAttr, Required
|
||||||
from .main import *
|
from pydantic.main import *
|
||||||
from .networks import *
|
from pydantic.networks import *
|
||||||
from .parse import Protocol
|
from pydantic.parse import Protocol
|
||||||
from .tools import *
|
from pydantic.tools import *
|
||||||
from .types import *
|
from pydantic.types import *
|
||||||
from .version import VERSION, compiled
|
from pydantic.version import VERSION, compiled
|
||||||
|
|
||||||
__version__ = VERSION
|
__version__ = VERSION
|
||||||
|
|
||||||
# WARNING __all__ from .errors is not included here, it will be removed as an export here in v2
|
# WARNING __all__ from pydantic.errors is not included here, it will be removed as an export here in v2
|
||||||
# please use "from pydantic.errors import ..." instead
|
# please use "from pydantic.errors import ..." instead
|
||||||
__all__ = [
|
__all__ = [
|
||||||
# annotated types utils
|
# annotated types utils
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import sys
|
import sys
|
||||||
from typing import TYPE_CHECKING, Any, Dict, FrozenSet, NamedTuple, Type
|
from typing import TYPE_CHECKING, Any, Dict, FrozenSet, NamedTuple, Type
|
||||||
|
|
||||||
from .fields import Required
|
from pydantic.fields import Required
|
||||||
from .main import BaseModel, create_model
|
from pydantic.main import BaseModel, create_model
|
||||||
from .typing import is_typeddict, is_typeddict_special
|
from pydantic.typing import is_typeddict, is_typeddict_special
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing_extensions import TypedDict
|
from typing_extensions import TypedDict
|
||||||
|
@ -5,12 +5,12 @@ from itertools import chain
|
|||||||
from types import FunctionType
|
from types import FunctionType
|
||||||
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, Union, overload
|
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, Union, overload
|
||||||
|
|
||||||
from .errors import ConfigError
|
from pydantic.errors import ConfigError
|
||||||
from .typing import AnyCallable
|
from pydantic.typing import AnyCallable
|
||||||
from .utils import ROOT_KEY, in_ipython
|
from pydantic.utils import ROOT_KEY, in_ipython
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .typing import AnyClassMethod
|
from pydantic.typing import AnyClassMethod
|
||||||
|
|
||||||
|
|
||||||
class Validator:
|
class Validator:
|
||||||
@ -36,9 +36,9 @@ class Validator:
|
|||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from inspect import Signature
|
from inspect import Signature
|
||||||
|
|
||||||
from .config import BaseConfig
|
from pydantic.config import BaseConfig
|
||||||
from .fields import ModelField
|
from pydantic.fields import ModelField
|
||||||
from .types import ModelOrDc
|
from pydantic.types import ModelOrDc
|
||||||
|
|
||||||
ValidatorCallable = Callable[[Optional[ModelOrDc], Any, Dict[str, Any], ModelField, Type[BaseConfig]], Any]
|
ValidatorCallable = Callable[[Optional[ModelOrDc], Any, Dict[str, Any], ModelField, Type[BaseConfig]], Any]
|
||||||
ValidatorsList = List[ValidatorCallable]
|
ValidatorsList = List[ValidatorCallable]
|
||||||
|
@ -12,11 +12,11 @@ import re
|
|||||||
from colorsys import hls_to_rgb, rgb_to_hls
|
from colorsys import hls_to_rgb, rgb_to_hls
|
||||||
from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union, cast
|
from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union, cast
|
||||||
|
|
||||||
from .errors import ColorError
|
from pydantic.errors import ColorError
|
||||||
from .utils import Representation, almost_equal_floats
|
from pydantic.utils import Representation, almost_equal_floats
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .typing import CallableGenerator, ReprArgs
|
from pydantic.typing import CallableGenerator, ReprArgs
|
||||||
|
|
||||||
ColorTuple = Union[Tuple[int, int, int], Tuple[int, int, int, float]]
|
ColorTuple = Union[Tuple[int, int, int], Tuple[int, int, int, float]]
|
||||||
ColorType = Union[ColorTuple, str]
|
ColorType = Union[ColorTuple, str]
|
||||||
|
@ -4,15 +4,15 @@ from typing import TYPE_CHECKING, Any, Callable, Dict, ForwardRef, Optional, Tup
|
|||||||
|
|
||||||
from typing_extensions import Literal, Protocol
|
from typing_extensions import Literal, Protocol
|
||||||
|
|
||||||
from .typing import AnyArgTCallable, AnyCallable
|
from pydantic.typing import AnyArgTCallable, AnyCallable
|
||||||
from .utils import GetterDict
|
from pydantic.utils import GetterDict
|
||||||
from .version import compiled
|
from pydantic.version import compiled
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import overload
|
from typing import overload
|
||||||
|
|
||||||
from .fields import ModelField
|
from pydantic.fields import ModelField
|
||||||
from .main import BaseModel
|
from pydantic.main import BaseModel
|
||||||
|
|
||||||
ConfigType = Type['BaseConfig']
|
ConfigType = Type['BaseConfig']
|
||||||
|
|
||||||
|
@ -47,17 +47,17 @@ from typing import TYPE_CHECKING, Any, Callable, ClassVar, Dict, Generator, Opti
|
|||||||
|
|
||||||
from typing_extensions import dataclass_transform
|
from typing_extensions import dataclass_transform
|
||||||
|
|
||||||
from .class_validators import gather_all_validators
|
from pydantic.class_validators import gather_all_validators
|
||||||
from .config import BaseConfig, ConfigDict, Extra, get_config
|
from pydantic.config import BaseConfig, ConfigDict, Extra, get_config
|
||||||
from .error_wrappers import ValidationError
|
from pydantic.error_wrappers import ValidationError
|
||||||
from .errors import DataclassTypeError
|
from pydantic.errors import DataclassTypeError
|
||||||
from .fields import Field, FieldInfo, Required, Undefined
|
from pydantic.fields import Field, FieldInfo, Required, Undefined
|
||||||
from .main import create_model, validate_model
|
from pydantic.main import create_model, validate_model
|
||||||
from .utils import ClassAttribute
|
from pydantic.utils import ClassAttribute
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .main import BaseModel
|
from pydantic.main import BaseModel
|
||||||
from .typing import CallableGenerator, NoArgAnyCallable
|
from pydantic.typing import CallableGenerator, NoArgAnyCallable
|
||||||
|
|
||||||
DataclassT = TypeVar('DataclassT', bound='Dataclass')
|
DataclassT = TypeVar('DataclassT', bound='Dataclass')
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ import re
|
|||||||
from datetime import date, datetime, time, timedelta, timezone
|
from datetime import date, datetime, time, timedelta, timezone
|
||||||
from typing import Dict, Optional, Type, Union
|
from typing import Dict, Optional, Type, Union
|
||||||
|
|
||||||
from . import errors
|
from pydantic import errors
|
||||||
|
|
||||||
date_expr = r'(?P<year>\d{4})-(?P<month>\d{1,2})-(?P<day>\d{1,2})'
|
date_expr = r'(?P<year>\d{4})-(?P<month>\d{1,2})-(?P<day>\d{1,2})'
|
||||||
time_expr = (
|
time_expr = (
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
from functools import wraps
|
from functools import wraps
|
||||||
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Mapping, Optional, Tuple, Type, TypeVar, Union, overload
|
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Mapping, Optional, Tuple, Type, TypeVar, Union, overload
|
||||||
|
|
||||||
from . import validator
|
from pydantic import validator
|
||||||
from .config import Extra
|
from pydantic.config import Extra
|
||||||
from .errors import ConfigError
|
from pydantic.errors import ConfigError
|
||||||
from .main import BaseModel, create_model
|
from pydantic.main import BaseModel, create_model
|
||||||
from .typing import get_all_type_hints
|
from pydantic.typing import get_all_type_hints
|
||||||
from .utils import to_camel
|
from pydantic.utils import to_camel
|
||||||
|
|
||||||
__all__ = ('validate_arguments',)
|
__all__ = ('validate_arguments',)
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .typing import AnyCallable
|
from pydantic.typing import AnyCallable
|
||||||
|
|
||||||
AnyCallableT = TypeVar('AnyCallableT', bound=AnyCallable)
|
AnyCallableT = TypeVar('AnyCallableT', bound=AnyCallable)
|
||||||
ConfigType = Union[None, Type[Any], Dict[str, Any]]
|
ConfigType = Union[None, Type[Any], Dict[str, Any]]
|
||||||
|
@ -3,12 +3,12 @@ import warnings
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import AbstractSet, Any, Callable, ClassVar, Dict, List, Mapping, Optional, Tuple, Type, Union
|
from typing import AbstractSet, Any, Callable, ClassVar, Dict, List, Mapping, Optional, Tuple, Type, Union
|
||||||
|
|
||||||
from .config import BaseConfig, Extra
|
from pydantic.config import BaseConfig, Extra
|
||||||
from .fields import ModelField
|
from pydantic.fields import ModelField
|
||||||
from .main import BaseModel
|
from pydantic.main import BaseModel
|
||||||
from .types import JsonWrapper
|
from pydantic.types import JsonWrapper
|
||||||
from .typing import StrPath, display_as_type, get_origin, is_union
|
from pydantic.typing import StrPath, display_as_type, get_origin, is_union
|
||||||
from .utils import deep_update, lenient_issubclass, path_type, sequence_like
|
from pydantic.utils import deep_update, lenient_issubclass, path_type, sequence_like
|
||||||
|
|
||||||
env_file_sentinel = str(object())
|
env_file_sentinel = str(object())
|
||||||
|
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import json
|
import json
|
||||||
from typing import TYPE_CHECKING, Any, Dict, Generator, List, Optional, Sequence, Tuple, Type, Union
|
from typing import TYPE_CHECKING, Any, Dict, Generator, List, Optional, Sequence, Tuple, Type, Union
|
||||||
|
|
||||||
from .json import pydantic_encoder
|
from pydantic.json import pydantic_encoder
|
||||||
from .utils import Representation
|
from pydantic.utils import Representation
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing_extensions import TypedDict
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
from .config import BaseConfig
|
from pydantic.config import BaseConfig
|
||||||
from .types import ModelOrDc
|
from pydantic.types import ModelOrDc
|
||||||
from .typing import ReprArgs
|
from pydantic.typing import ReprArgs
|
||||||
|
|
||||||
Loc = Tuple[Union[int, str], ...]
|
Loc = Tuple[Union[int, str], ...]
|
||||||
|
|
||||||
|
@ -2,12 +2,12 @@ from decimal import Decimal
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING, Any, Callable, Sequence, Set, Tuple, Type, Union
|
from typing import TYPE_CHECKING, Any, Callable, Sequence, Set, Tuple, Type, Union
|
||||||
|
|
||||||
from .typing import display_as_type
|
from pydantic.typing import display_as_type
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .typing import DictStrAny
|
from pydantic.typing import DictStrAny
|
||||||
|
|
||||||
# explicitly state exports to avoid "from .errors import *" also importing Decimal, Path etc.
|
# explicitly state exports to avoid "from pydantic.errors import *" also importing Decimal, Path etc.
|
||||||
__all__ = (
|
__all__ = (
|
||||||
'PydanticTypeError',
|
'PydanticTypeError',
|
||||||
'PydanticValueError',
|
'PydanticValueError',
|
||||||
|
@ -28,12 +28,12 @@ from typing import (
|
|||||||
|
|
||||||
from typing_extensions import Annotated, Final
|
from typing_extensions import Annotated, Final
|
||||||
|
|
||||||
from . import errors as errors_
|
from pydantic import errors as errors_
|
||||||
from .class_validators import Validator, make_generic_validator, prep_validators
|
from pydantic.class_validators import Validator, make_generic_validator, prep_validators
|
||||||
from .error_wrappers import ErrorWrapper
|
from pydantic.error_wrappers import ErrorWrapper
|
||||||
from .errors import ConfigError, InvalidDiscriminator, MissingDiscriminator, NoneIsNotAllowedError
|
from pydantic.errors import ConfigError, InvalidDiscriminator, MissingDiscriminator, NoneIsNotAllowedError
|
||||||
from .types import Json, JsonWrapper
|
from pydantic.types import Json, JsonWrapper
|
||||||
from .typing import (
|
from pydantic.typing import (
|
||||||
NoArgAnyCallable,
|
NoArgAnyCallable,
|
||||||
convert_generics,
|
convert_generics,
|
||||||
display_as_type,
|
display_as_type,
|
||||||
@ -48,7 +48,7 @@ from .typing import (
|
|||||||
is_union,
|
is_union,
|
||||||
new_type_supertype,
|
new_type_supertype,
|
||||||
)
|
)
|
||||||
from .utils import (
|
from pydantic.utils import (
|
||||||
PyObjectStr,
|
PyObjectStr,
|
||||||
Representation,
|
Representation,
|
||||||
ValueItems,
|
ValueItems,
|
||||||
@ -59,7 +59,7 @@ from .utils import (
|
|||||||
sequence_like,
|
sequence_like,
|
||||||
smart_deepcopy,
|
smart_deepcopy,
|
||||||
)
|
)
|
||||||
from .validators import constant_validator, dict_validator, find_validators, validate_json
|
from pydantic.validators import constant_validator, dict_validator, find_validators, validate_json
|
||||||
|
|
||||||
Required: Any = Ellipsis
|
Required: Any = Ellipsis
|
||||||
|
|
||||||
@ -83,11 +83,11 @@ class UndefinedType:
|
|||||||
Undefined = UndefinedType()
|
Undefined = UndefinedType()
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .class_validators import ValidatorsList
|
from pydantic.class_validators import ValidatorsList
|
||||||
from .config import BaseConfig
|
from pydantic.config import BaseConfig
|
||||||
from .error_wrappers import ErrorList
|
from pydantic.error_wrappers import ErrorList
|
||||||
from .types import ModelOrDc
|
from pydantic.types import ModelOrDc
|
||||||
from .typing import AbstractSetIntStr, MappingIntStrAny, ReprArgs
|
from pydantic.typing import AbstractSetIntStr, MappingIntStrAny, ReprArgs
|
||||||
|
|
||||||
ValidateReturn = Tuple[Optional[Any], Optional[ErrorList]]
|
ValidateReturn = Tuple[Optional[Any], Optional[ErrorList]]
|
||||||
LocStr = Union[Tuple[Union[int, str], ...], str]
|
LocStr = Union[Tuple[Union[int, str], ...], str]
|
||||||
@ -490,7 +490,7 @@ class ModelField(Representation):
|
|||||||
class_validators: Optional[Dict[str, Validator]],
|
class_validators: Optional[Dict[str, Validator]],
|
||||||
config: Type['BaseConfig'],
|
config: Type['BaseConfig'],
|
||||||
) -> 'ModelField':
|
) -> 'ModelField':
|
||||||
from .schema import get_annotation_from_field_info
|
from pydantic.schema import get_annotation_from_field_info
|
||||||
|
|
||||||
field_info, value = cls._get_field_info(name, annotation, value, config)
|
field_info, value = cls._get_field_info(name, annotation, value, config)
|
||||||
required: 'BoolUndefined' = Undefined
|
required: 'BoolUndefined' = Undefined
|
||||||
@ -1160,7 +1160,7 @@ class ModelField(Representation):
|
|||||||
"""
|
"""
|
||||||
Whether the field is "complex" eg. env variables should be parsed as JSON.
|
Whether the field is "complex" eg. env variables should be parsed as JSON.
|
||||||
"""
|
"""
|
||||||
from .main import BaseModel
|
from pydantic.main import BaseModel
|
||||||
|
|
||||||
return (
|
return (
|
||||||
self.shape != SHAPE_SINGLETON
|
self.shape != SHAPE_SINGLETON
|
||||||
|
@ -22,12 +22,12 @@ from weakref import WeakKeyDictionary, WeakValueDictionary
|
|||||||
|
|
||||||
from typing_extensions import Annotated, Literal as ExtLiteral
|
from typing_extensions import Annotated, Literal as ExtLiteral
|
||||||
|
|
||||||
from .class_validators import gather_all_validators
|
from pydantic.class_validators import gather_all_validators
|
||||||
from .fields import DeferredType
|
from pydantic.fields import DeferredType
|
||||||
from .main import BaseModel, create_model
|
from pydantic.main import BaseModel, create_model
|
||||||
from .types import JsonWrapper
|
from pydantic.types import JsonWrapper
|
||||||
from .typing import display_as_type, get_all_type_hints, get_args, get_origin, typing_base
|
from pydantic.typing import display_as_type, get_all_type_hints, get_args, get_origin, typing_base
|
||||||
from .utils import all_identical, lenient_issubclass
|
from pydantic.utils import all_identical, lenient_issubclass
|
||||||
|
|
||||||
if sys.version_info >= (3, 10):
|
if sys.version_info >= (3, 10):
|
||||||
from typing import _UnionGenericAlias
|
from typing import _UnionGenericAlias
|
||||||
|
@ -9,9 +9,9 @@ from types import GeneratorType
|
|||||||
from typing import Any, Callable, Dict, Type, Union
|
from typing import Any, Callable, Dict, Type, Union
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from .color import Color
|
from pydantic.color import Color
|
||||||
from .networks import NameEmail
|
from pydantic.networks import NameEmail
|
||||||
from .types import SecretBytes, SecretStr
|
from pydantic.types import SecretBytes, SecretStr
|
||||||
|
|
||||||
__all__ = 'pydantic_encoder', 'custom_pydantic_encoder', 'timedelta_isoformat'
|
__all__ = 'pydantic_encoder', 'custom_pydantic_encoder', 'timedelta_isoformat'
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ ENCODERS_BY_TYPE: Dict[Type[Any], Callable[[Any], Any]] = {
|
|||||||
def pydantic_encoder(obj: Any) -> Any:
|
def pydantic_encoder(obj: Any) -> Any:
|
||||||
from dataclasses import asdict, is_dataclass
|
from dataclasses import asdict, is_dataclass
|
||||||
|
|
||||||
from .main import BaseModel
|
from pydantic.main import BaseModel
|
||||||
|
|
||||||
if isinstance(obj, BaseModel):
|
if isinstance(obj, BaseModel):
|
||||||
return obj.dict()
|
return obj.dict()
|
||||||
|
@ -26,11 +26,11 @@ from typing import (
|
|||||||
|
|
||||||
from typing_extensions import dataclass_transform
|
from typing_extensions import dataclass_transform
|
||||||
|
|
||||||
from .class_validators import ValidatorGroup, extract_root_validators, extract_validators, inherit_validators
|
from pydantic.class_validators import ValidatorGroup, extract_root_validators, extract_validators, inherit_validators
|
||||||
from .config import BaseConfig, Extra, inherit_config, prepare_config
|
from pydantic.config import BaseConfig, Extra, inherit_config, prepare_config
|
||||||
from .error_wrappers import ErrorWrapper, ValidationError
|
from pydantic.error_wrappers import ErrorWrapper, ValidationError
|
||||||
from .errors import ConfigError, DictError, ExtraError, MissingError
|
from pydantic.errors import ConfigError, DictError, ExtraError, MissingError
|
||||||
from .fields import (
|
from pydantic.fields import (
|
||||||
MAPPING_LIKE_SHAPES,
|
MAPPING_LIKE_SHAPES,
|
||||||
Field,
|
Field,
|
||||||
ModelField,
|
ModelField,
|
||||||
@ -39,11 +39,11 @@ from .fields import (
|
|||||||
Undefined,
|
Undefined,
|
||||||
is_finalvar_with_default_val,
|
is_finalvar_with_default_val,
|
||||||
)
|
)
|
||||||
from .json import custom_pydantic_encoder, pydantic_encoder
|
from pydantic.json import custom_pydantic_encoder, pydantic_encoder
|
||||||
from .parse import Protocol, load_file, load_str_bytes
|
from pydantic.parse import Protocol, load_file, load_str_bytes
|
||||||
from .schema import default_ref_template, model_schema
|
from pydantic.schema import default_ref_template, model_schema
|
||||||
from .types import PyObject, StrBytes
|
from pydantic.types import PyObject, StrBytes
|
||||||
from .typing import (
|
from pydantic.typing import (
|
||||||
AnyCallable,
|
AnyCallable,
|
||||||
get_args,
|
get_args,
|
||||||
get_origin,
|
get_origin,
|
||||||
@ -53,7 +53,7 @@ from .typing import (
|
|||||||
resolve_annotations,
|
resolve_annotations,
|
||||||
update_model_forward_refs,
|
update_model_forward_refs,
|
||||||
)
|
)
|
||||||
from .utils import (
|
from pydantic.utils import (
|
||||||
DUNDER_ATTRIBUTES,
|
DUNDER_ATTRIBUTES,
|
||||||
ROOT_KEY,
|
ROOT_KEY,
|
||||||
ClassAttribute,
|
ClassAttribute,
|
||||||
@ -73,9 +73,9 @@ from .utils import (
|
|||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from inspect import Signature
|
from inspect import Signature
|
||||||
|
|
||||||
from .class_validators import ValidatorListDict
|
from pydantic.class_validators import ValidatorListDict
|
||||||
from .types import ModelOrDc
|
from pydantic.types import ModelOrDc
|
||||||
from .typing import (
|
from pydantic.typing import (
|
||||||
AbstractSetIntStr,
|
AbstractSetIntStr,
|
||||||
AnyClassMethod,
|
AnyClassMethod,
|
||||||
CallableGenerator,
|
CallableGenerator,
|
||||||
@ -669,7 +669,7 @@ class BaseModel(Representation, metaclass=ModelMetaclass):
|
|||||||
def schema_json(
|
def schema_json(
|
||||||
cls, *, by_alias: bool = True, ref_template: str = default_ref_template, **dumps_kwargs: Any
|
cls, *, by_alias: bool = True, ref_template: str = default_ref_template, **dumps_kwargs: Any
|
||||||
) -> str:
|
) -> str:
|
||||||
from .json import pydantic_encoder
|
from pydantic.json import pydantic_encoder
|
||||||
|
|
||||||
return cls.__config__.json_dumps(
|
return cls.__config__.json_dumps(
|
||||||
cls.schema(by_alias=by_alias, ref_template=ref_template), default=pydantic_encoder, **dumps_kwargs
|
cls.schema(by_alias=by_alias, ref_template=ref_template), default=pydantic_encoder, **dumps_kwargs
|
||||||
|
@ -57,6 +57,7 @@ from mypy.types import (
|
|||||||
Type,
|
Type,
|
||||||
TypeOfAny,
|
TypeOfAny,
|
||||||
TypeType,
|
TypeType,
|
||||||
|
TypeVarId,
|
||||||
TypeVarType,
|
TypeVarType,
|
||||||
UnionType,
|
UnionType,
|
||||||
get_proper_type,
|
get_proper_type,
|
||||||
@ -498,7 +499,7 @@ class PydanticModelTransformer:
|
|||||||
tvd = TypeVarType(
|
tvd = TypeVarType(
|
||||||
self_tvar_name,
|
self_tvar_name,
|
||||||
tvar_fullname,
|
tvar_fullname,
|
||||||
-1,
|
TypeVarId(-1),
|
||||||
[],
|
[],
|
||||||
obj_type,
|
obj_type,
|
||||||
AnyType(TypeOfAny.from_omitted_generics), # type: ignore[arg-type]
|
AnyType(TypeOfAny.from_omitted_generics), # type: ignore[arg-type]
|
||||||
|
@ -27,17 +27,17 @@ from typing import (
|
|||||||
no_type_check,
|
no_type_check,
|
||||||
)
|
)
|
||||||
|
|
||||||
from . import errors
|
from pydantic import errors
|
||||||
from .utils import Representation, update_not_none
|
from pydantic.utils import Representation, update_not_none
|
||||||
from .validators import constr_length_validator, str_validator
|
from pydantic.validators import constr_length_validator, str_validator
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
import email_validator
|
import email_validator
|
||||||
from typing_extensions import TypedDict
|
from typing_extensions import TypedDict
|
||||||
|
|
||||||
from .config import BaseConfig
|
from pydantic.config import BaseConfig
|
||||||
from .fields import ModelField
|
from pydantic.fields import ModelField
|
||||||
from .typing import AnyCallable
|
from pydantic.typing import AnyCallable
|
||||||
|
|
||||||
CallableGenerator = Generator[AnyCallable, None, None]
|
CallableGenerator = Generator[AnyCallable, None, None]
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ from enum import Enum
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Callable, Union
|
from typing import Any, Callable, Union
|
||||||
|
|
||||||
from .types import StrBytes
|
from pydantic.types import StrBytes
|
||||||
|
|
||||||
|
|
||||||
class Protocol(str, Enum):
|
class Protocol(str, Enum):
|
||||||
|
@ -31,7 +31,7 @@ from uuid import UUID
|
|||||||
|
|
||||||
from typing_extensions import Annotated, Literal
|
from typing_extensions import Annotated, Literal
|
||||||
|
|
||||||
from .fields import (
|
from pydantic.fields import (
|
||||||
MAPPING_LIKE_SHAPES,
|
MAPPING_LIKE_SHAPES,
|
||||||
SHAPE_DEQUE,
|
SHAPE_DEQUE,
|
||||||
SHAPE_FROZENSET,
|
SHAPE_FROZENSET,
|
||||||
@ -46,9 +46,9 @@ from .fields import (
|
|||||||
FieldInfo,
|
FieldInfo,
|
||||||
ModelField,
|
ModelField,
|
||||||
)
|
)
|
||||||
from .json import pydantic_encoder
|
from pydantic.json import pydantic_encoder
|
||||||
from .networks import AnyUrl, EmailStr
|
from pydantic.networks import AnyUrl, EmailStr
|
||||||
from .types import (
|
from pydantic.types import (
|
||||||
ConstrainedDecimal,
|
ConstrainedDecimal,
|
||||||
ConstrainedFloat,
|
ConstrainedFloat,
|
||||||
ConstrainedFrozenSet,
|
ConstrainedFrozenSet,
|
||||||
@ -69,7 +69,7 @@ from .types import (
|
|||||||
conset,
|
conset,
|
||||||
constr,
|
constr,
|
||||||
)
|
)
|
||||||
from .typing import (
|
from pydantic.typing import (
|
||||||
all_literal_values,
|
all_literal_values,
|
||||||
get_args,
|
get_args,
|
||||||
get_origin,
|
get_origin,
|
||||||
@ -80,11 +80,11 @@ from .typing import (
|
|||||||
is_none_type,
|
is_none_type,
|
||||||
is_union,
|
is_union,
|
||||||
)
|
)
|
||||||
from .utils import ROOT_KEY, get_model, lenient_issubclass
|
from pydantic.utils import ROOT_KEY, get_model, lenient_issubclass
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .dataclasses import Dataclass
|
from pydantic.dataclasses import Dataclass
|
||||||
from .main import BaseModel
|
from pydantic.main import BaseModel
|
||||||
|
|
||||||
default_prefix = '#/definitions/'
|
default_prefix = '#/definitions/'
|
||||||
default_ref_template = '#/definitions/{model}'
|
default_ref_template = '#/definitions/{model}'
|
||||||
@ -378,7 +378,7 @@ def get_flat_models_from_field(field: ModelField, known_models: TypeModelSet) ->
|
|||||||
:param known_models: used to solve circular references
|
:param known_models: used to solve circular references
|
||||||
:return: a set with the model used in the declaration for this field, if any, and all its sub-models
|
:return: a set with the model used in the declaration for this field, if any, and all its sub-models
|
||||||
"""
|
"""
|
||||||
from .main import BaseModel
|
from pydantic.main import BaseModel
|
||||||
|
|
||||||
flat_models: TypeModelSet = set()
|
flat_models: TypeModelSet = set()
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ def field_type_schema(
|
|||||||
Take a single ``field`` and generate the schema for its type only, not including additional
|
Take a single ``field`` and generate the schema for its type only, not including additional
|
||||||
information as title, etc. Also return additional schema definitions, from sub-models.
|
information as title, etc. Also return additional schema definitions, from sub-models.
|
||||||
"""
|
"""
|
||||||
from .main import BaseModel # noqa: F811
|
from pydantic.main import BaseModel # noqa: F811
|
||||||
|
|
||||||
definitions = {}
|
definitions = {}
|
||||||
nested_models: Set[str] = set()
|
nested_models: Set[str] = set()
|
||||||
@ -838,7 +838,7 @@ def field_singleton_schema( # noqa: C901 (ignore complexity)
|
|||||||
|
|
||||||
Take a single Pydantic ``ModelField``, and return its schema and any additional definitions from sub-models.
|
Take a single Pydantic ``ModelField``, and return its schema and any additional definitions from sub-models.
|
||||||
"""
|
"""
|
||||||
from .main import BaseModel
|
from pydantic.main import BaseModel
|
||||||
|
|
||||||
definitions: Dict[str, Any] = {}
|
definitions: Dict[str, Any] = {}
|
||||||
nested_models: Set[str] = set()
|
nested_models: Set[str] = set()
|
||||||
@ -974,7 +974,7 @@ def multitypes_literal_field_for_schema(values: Tuple[Any, ...], field: ModelFie
|
|||||||
|
|
||||||
|
|
||||||
def encode_default(dft: Any) -> Any:
|
def encode_default(dft: Any) -> Any:
|
||||||
from .main import BaseModel
|
from pydantic.main import BaseModel
|
||||||
|
|
||||||
if isinstance(dft, BaseModel) or is_dataclass(dft):
|
if isinstance(dft, BaseModel) or is_dataclass(dft):
|
||||||
dft = cast('dict[str, Any]', pydantic_encoder(dft))
|
dft = cast('dict[str, Any]', pydantic_encoder(dft))
|
||||||
|
@ -3,16 +3,16 @@ from functools import lru_cache
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING, Any, Callable, Optional, Type, TypeVar, Union
|
from typing import TYPE_CHECKING, Any, Callable, Optional, Type, TypeVar, Union
|
||||||
|
|
||||||
from .parse import Protocol, load_file, load_str_bytes
|
from pydantic.parse import Protocol, load_file, load_str_bytes
|
||||||
from .types import StrBytes
|
from pydantic.types import StrBytes
|
||||||
from .typing import display_as_type
|
from pydantic.typing import display_as_type
|
||||||
|
|
||||||
__all__ = ('parse_file_as', 'parse_obj_as', 'parse_raw_as', 'schema_of', 'schema_json_of')
|
__all__ = ('parse_file_as', 'parse_obj_as', 'parse_raw_as', 'schema_of', 'schema_json_of')
|
||||||
|
|
||||||
NameFactory = Union[str, Callable[[Type[Any]], str]]
|
NameFactory = Union[str, Callable[[Type[Any]], str]]
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .typing import DictStrAny
|
from pydantic.typing import DictStrAny
|
||||||
|
|
||||||
|
|
||||||
def _generate_parsing_type_name(type_: Any) -> str:
|
def _generate_parsing_type_name(type_: Any) -> str:
|
||||||
@ -21,7 +21,7 @@ def _generate_parsing_type_name(type_: Any) -> str:
|
|||||||
|
|
||||||
@lru_cache(maxsize=2048)
|
@lru_cache(maxsize=2048)
|
||||||
def _get_parsing_type(type_: Any, *, type_name: Optional[NameFactory] = None) -> Any:
|
def _get_parsing_type(type_: Any, *, type_name: Optional[NameFactory] = None) -> Any:
|
||||||
from .main import create_model
|
from pydantic.main import create_model
|
||||||
|
|
||||||
if type_name is None:
|
if type_name is None:
|
||||||
type_name = _generate_parsing_type_name
|
type_name = _generate_parsing_type_name
|
||||||
|
@ -28,10 +28,10 @@ from typing import (
|
|||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
from weakref import WeakSet
|
from weakref import WeakSet
|
||||||
|
|
||||||
from . import errors
|
from pydantic import errors
|
||||||
from .datetime_parse import parse_date
|
from pydantic.datetime_parse import parse_date
|
||||||
from .utils import import_string, update_not_none
|
from pydantic.utils import import_string, update_not_none
|
||||||
from .validators import (
|
from pydantic.validators import (
|
||||||
bytes_validator,
|
bytes_validator,
|
||||||
constr_length_validator,
|
constr_length_validator,
|
||||||
constr_lower,
|
constr_lower,
|
||||||
@ -123,9 +123,9 @@ StrIntFloat = Union[str, int, float]
|
|||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing_extensions import Annotated
|
from typing_extensions import Annotated
|
||||||
|
|
||||||
from .dataclasses import Dataclass
|
from pydantic.dataclasses import Dataclass
|
||||||
from .main import BaseModel
|
from pydantic.main import BaseModel
|
||||||
from .typing import CallableGenerator
|
from pydantic.typing import CallableGenerator
|
||||||
|
|
||||||
ModelOrDc = Type[Union[BaseModel, Dataclass]]
|
ModelOrDc = Type[Union[BaseModel, Dataclass]]
|
||||||
|
|
||||||
|
@ -63,7 +63,9 @@ else:
|
|||||||
def evaluate_forwardref(type_: ForwardRef, globalns: Any, localns: Any) -> Any:
|
def evaluate_forwardref(type_: ForwardRef, globalns: Any, localns: Any) -> Any:
|
||||||
# Even though it is the right signature for python 3.9, mypy complains with
|
# Even though it is the right signature for python 3.9, mypy complains with
|
||||||
# `error: Too many arguments for "_evaluate" of "ForwardRef"` hence the cast...
|
# `error: Too many arguments for "_evaluate" of "ForwardRef"` hence the cast...
|
||||||
return cast(Any, type_)._evaluate(globalns, localns, set())
|
# Python 3.13/3.12.4+ made `recursive_guard` a kwarg, so name it explicitly to avoid:
|
||||||
|
# TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
|
||||||
|
return cast(Any, type_)._evaluate(globalns, localns, recursive_guard=set())
|
||||||
|
|
||||||
|
|
||||||
if sys.version_info < (3, 9):
|
if sys.version_info < (3, 9):
|
||||||
@ -256,7 +258,7 @@ StrPath = Union[str, PathLike]
|
|||||||
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .fields import ModelField
|
from pydantic.fields import ModelField
|
||||||
|
|
||||||
TupleGenerator = Generator[Tuple[str, Any], None, None]
|
TupleGenerator = Generator[Tuple[str, Any], None, None]
|
||||||
DictStrAny = Dict[str, Any]
|
DictStrAny = Dict[str, Any]
|
||||||
@ -435,7 +437,7 @@ def is_namedtuple(type_: Type[Any]) -> bool:
|
|||||||
Check if a given class is a named tuple.
|
Check if a given class is a named tuple.
|
||||||
It can be either a `typing.NamedTuple` or `collections.namedtuple`
|
It can be either a `typing.NamedTuple` or `collections.namedtuple`
|
||||||
"""
|
"""
|
||||||
from .utils import lenient_issubclass
|
from pydantic.utils import lenient_issubclass
|
||||||
|
|
||||||
return lenient_issubclass(type_, tuple) and hasattr(type_, '_fields')
|
return lenient_issubclass(type_, tuple) and hasattr(type_, '_fields')
|
||||||
|
|
||||||
@ -445,7 +447,7 @@ def is_typeddict(type_: Type[Any]) -> bool:
|
|||||||
Check if a given class is a typed dict (from `typing` or `typing_extensions`)
|
Check if a given class is a typed dict (from `typing` or `typing_extensions`)
|
||||||
In 3.10, there will be a public method (https://docs.python.org/3.10/library/typing.html#typing.is_typeddict)
|
In 3.10, there will be a public method (https://docs.python.org/3.10/library/typing.html#typing.is_typeddict)
|
||||||
"""
|
"""
|
||||||
from .utils import lenient_issubclass
|
from pydantic.utils import lenient_issubclass
|
||||||
|
|
||||||
return lenient_issubclass(type_, dict) and hasattr(type_, '__total__')
|
return lenient_issubclass(type_, dict) and hasattr(type_, '__total__')
|
||||||
|
|
||||||
|
@ -28,8 +28,8 @@ from typing import (
|
|||||||
|
|
||||||
from typing_extensions import Annotated
|
from typing_extensions import Annotated
|
||||||
|
|
||||||
from .errors import ConfigError
|
from pydantic.errors import ConfigError
|
||||||
from .typing import (
|
from pydantic.typing import (
|
||||||
NoneType,
|
NoneType,
|
||||||
WithArgsTypes,
|
WithArgsTypes,
|
||||||
all_literal_values,
|
all_literal_values,
|
||||||
@ -39,17 +39,17 @@ from .typing import (
|
|||||||
is_literal_type,
|
is_literal_type,
|
||||||
is_union,
|
is_union,
|
||||||
)
|
)
|
||||||
from .version import version_info
|
from pydantic.version import version_info
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from inspect import Signature
|
from inspect import Signature
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from .config import BaseConfig
|
from pydantic.config import BaseConfig
|
||||||
from .dataclasses import Dataclass
|
from pydantic.dataclasses import Dataclass
|
||||||
from .fields import ModelField
|
from pydantic.fields import ModelField
|
||||||
from .main import BaseModel
|
from pydantic.main import BaseModel
|
||||||
from .typing import AbstractSetIntStr, DictIntStrAny, IntStr, MappingIntStrAny, ReprArgs
|
from pydantic.typing import AbstractSetIntStr, DictIntStrAny, IntStr, MappingIntStrAny, ReprArgs
|
||||||
|
|
||||||
RichReprResult = Iterable[Union[Any, Tuple[Any], Tuple[str, Any], Tuple[str, Any, Any]]]
|
RichReprResult = Iterable[Union[Any, Tuple[Any], Tuple[str, Any], Tuple[str, Any, Any]]]
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ def generate_model_signature(
|
|||||||
"""
|
"""
|
||||||
from inspect import Parameter, Signature, signature
|
from inspect import Parameter, Signature, signature
|
||||||
|
|
||||||
from .config import Extra
|
from pydantic.config import Extra
|
||||||
|
|
||||||
present_params = signature(init).parameters.values()
|
present_params = signature(init).parameters.values()
|
||||||
merged_params: Dict[str, Parameter] = {}
|
merged_params: Dict[str, Parameter] = {}
|
||||||
@ -298,7 +298,7 @@ def generate_model_signature(
|
|||||||
|
|
||||||
|
|
||||||
def get_model(obj: Union[Type['BaseModel'], Type['Dataclass']]) -> Type['BaseModel']:
|
def get_model(obj: Union[Type['BaseModel'], Type['Dataclass']]) -> Type['BaseModel']:
|
||||||
from .main import BaseModel
|
from pydantic.main import BaseModel
|
||||||
|
|
||||||
try:
|
try:
|
||||||
model_cls = obj.__pydantic_model__ # type: ignore
|
model_cls = obj.__pydantic_model__ # type: ignore
|
||||||
|
130
site-packages/pydantic/v1.py
Normal file
130
site-packages/pydantic/v1.py
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
# NOTE This file aliases the pydantic namespace as pydantic.v1 for smoother v1 -> v2 transition
|
||||||
|
# flake8: noqa
|
||||||
|
import importlib
|
||||||
|
import os
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
|
import pydantic
|
||||||
|
from pydantic import *
|
||||||
|
|
||||||
|
|
||||||
|
# allows importing of objects from modules directly
|
||||||
|
# i.e. from pydantic.v1.fields import ModelField
|
||||||
|
def __getattr__(name: str) -> Any:
|
||||||
|
"""Module level `__getattr__` to allow imports directly from the `pydantic.v1`
|
||||||
|
namespace for all pydantic modules."""
|
||||||
|
return getattr(pydantic, name)
|
||||||
|
|
||||||
|
|
||||||
|
# WARNING __all__ from pydantic.errors is not included here, it will be removed as an export here in v2
|
||||||
|
# please use "from pydantic.errors import ..." instead
|
||||||
|
__all__ = [
|
||||||
|
# annotated types utils
|
||||||
|
"create_model_from_namedtuple",
|
||||||
|
"create_model_from_typeddict",
|
||||||
|
# dataclasses
|
||||||
|
"dataclasses",
|
||||||
|
# class_validators
|
||||||
|
"root_validator",
|
||||||
|
"validator",
|
||||||
|
# config
|
||||||
|
"BaseConfig",
|
||||||
|
"ConfigDict",
|
||||||
|
"Extra",
|
||||||
|
# decorator
|
||||||
|
"validate_arguments",
|
||||||
|
# env_settings
|
||||||
|
"BaseSettings",
|
||||||
|
# error_wrappers
|
||||||
|
"ValidationError",
|
||||||
|
# fields
|
||||||
|
"Field",
|
||||||
|
"Required",
|
||||||
|
# main
|
||||||
|
"BaseModel",
|
||||||
|
"create_model",
|
||||||
|
"validate_model",
|
||||||
|
# network
|
||||||
|
"AnyUrl",
|
||||||
|
"AnyHttpUrl",
|
||||||
|
"FileUrl",
|
||||||
|
"HttpUrl",
|
||||||
|
"stricturl",
|
||||||
|
"EmailStr",
|
||||||
|
"NameEmail",
|
||||||
|
"IPvAnyAddress",
|
||||||
|
"IPvAnyInterface",
|
||||||
|
"IPvAnyNetwork",
|
||||||
|
"PostgresDsn",
|
||||||
|
"CockroachDsn",
|
||||||
|
"AmqpDsn",
|
||||||
|
"RedisDsn",
|
||||||
|
"MongoDsn",
|
||||||
|
"KafkaDsn",
|
||||||
|
"validate_email",
|
||||||
|
# parse
|
||||||
|
"Protocol",
|
||||||
|
# tools
|
||||||
|
"parse_file_as",
|
||||||
|
"parse_obj_as",
|
||||||
|
"parse_raw_as",
|
||||||
|
"schema_of",
|
||||||
|
"schema_json_of",
|
||||||
|
# types
|
||||||
|
"NoneStr",
|
||||||
|
"NoneBytes",
|
||||||
|
"StrBytes",
|
||||||
|
"NoneStrBytes",
|
||||||
|
"StrictStr",
|
||||||
|
"ConstrainedBytes",
|
||||||
|
"conbytes",
|
||||||
|
"ConstrainedList",
|
||||||
|
"conlist",
|
||||||
|
"ConstrainedSet",
|
||||||
|
"conset",
|
||||||
|
"ConstrainedFrozenSet",
|
||||||
|
"confrozenset",
|
||||||
|
"ConstrainedStr",
|
||||||
|
"constr",
|
||||||
|
"PyObject",
|
||||||
|
"ConstrainedInt",
|
||||||
|
"conint",
|
||||||
|
"PositiveInt",
|
||||||
|
"NegativeInt",
|
||||||
|
"NonNegativeInt",
|
||||||
|
"NonPositiveInt",
|
||||||
|
"ConstrainedFloat",
|
||||||
|
"confloat",
|
||||||
|
"PositiveFloat",
|
||||||
|
"NegativeFloat",
|
||||||
|
"NonNegativeFloat",
|
||||||
|
"NonPositiveFloat",
|
||||||
|
"FiniteFloat",
|
||||||
|
"ConstrainedDecimal",
|
||||||
|
"condecimal",
|
||||||
|
"ConstrainedDate",
|
||||||
|
"condate",
|
||||||
|
"UUID1",
|
||||||
|
"UUID3",
|
||||||
|
"UUID4",
|
||||||
|
"UUID5",
|
||||||
|
"FilePath",
|
||||||
|
"DirectoryPath",
|
||||||
|
"Json",
|
||||||
|
"JsonWrapper",
|
||||||
|
"SecretField",
|
||||||
|
"SecretStr",
|
||||||
|
"SecretBytes",
|
||||||
|
"StrictBool",
|
||||||
|
"StrictBytes",
|
||||||
|
"StrictInt",
|
||||||
|
"StrictFloat",
|
||||||
|
"PaymentCardNumber",
|
||||||
|
"PrivateAttr",
|
||||||
|
"ByteSize",
|
||||||
|
"PastDate",
|
||||||
|
"FutureDate",
|
||||||
|
# version
|
||||||
|
"compiled",
|
||||||
|
"VERSION",
|
||||||
|
]
|
@ -28,9 +28,9 @@ from typing import (
|
|||||||
)
|
)
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from . import errors
|
from pydantic import errors
|
||||||
from .datetime_parse import parse_date, parse_datetime, parse_duration, parse_time
|
from pydantic.datetime_parse import parse_date, parse_datetime, parse_duration, parse_time
|
||||||
from .typing import (
|
from pydantic.typing import (
|
||||||
AnyCallable,
|
AnyCallable,
|
||||||
all_literal_values,
|
all_literal_values,
|
||||||
display_as_type,
|
display_as_type,
|
||||||
@ -41,14 +41,14 @@ from .typing import (
|
|||||||
is_none_type,
|
is_none_type,
|
||||||
is_typeddict,
|
is_typeddict,
|
||||||
)
|
)
|
||||||
from .utils import almost_equal_floats, lenient_issubclass, sequence_like
|
from pydantic.utils import almost_equal_floats, lenient_issubclass, sequence_like
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing_extensions import Literal, TypedDict
|
from typing_extensions import Literal, TypedDict
|
||||||
|
|
||||||
from .config import BaseConfig
|
from pydantic.config import BaseConfig
|
||||||
from .fields import ModelField
|
from pydantic.fields import ModelField
|
||||||
from .types import ConstrainedDecimal, ConstrainedFloat, ConstrainedInt
|
from pydantic.types import ConstrainedDecimal, ConstrainedFloat, ConstrainedInt
|
||||||
|
|
||||||
ConstrainedNumber = Union[ConstrainedDecimal, ConstrainedFloat, ConstrainedInt]
|
ConstrainedNumber = Union[ConstrainedDecimal, ConstrainedFloat, ConstrainedInt]
|
||||||
AnyOrderedDict = OrderedDict[Any, Any]
|
AnyOrderedDict = OrderedDict[Any, Any]
|
||||||
@ -594,7 +594,7 @@ NamedTupleT = TypeVar('NamedTupleT', bound=NamedTuple)
|
|||||||
def make_namedtuple_validator(
|
def make_namedtuple_validator(
|
||||||
namedtuple_cls: Type[NamedTupleT], config: Type['BaseConfig']
|
namedtuple_cls: Type[NamedTupleT], config: Type['BaseConfig']
|
||||||
) -> Callable[[Tuple[Any, ...]], NamedTupleT]:
|
) -> Callable[[Tuple[Any, ...]], NamedTupleT]:
|
||||||
from .annotated_types import create_model_from_namedtuple
|
from pydantic.annotated_types import create_model_from_namedtuple
|
||||||
|
|
||||||
NamedTupleModel = create_model_from_namedtuple(
|
NamedTupleModel = create_model_from_namedtuple(
|
||||||
namedtuple_cls,
|
namedtuple_cls,
|
||||||
@ -619,7 +619,7 @@ def make_namedtuple_validator(
|
|||||||
def make_typeddict_validator(
|
def make_typeddict_validator(
|
||||||
typeddict_cls: Type['TypedDict'], config: Type['BaseConfig'] # type: ignore[valid-type]
|
typeddict_cls: Type['TypedDict'], config: Type['BaseConfig'] # type: ignore[valid-type]
|
||||||
) -> Callable[[Any], Dict[str, Any]]:
|
) -> Callable[[Any], Dict[str, Any]]:
|
||||||
from .annotated_types import create_model_from_typeddict
|
from pydantic.annotated_types import create_model_from_typeddict
|
||||||
|
|
||||||
TypedDictModel = create_model_from_typeddict(
|
TypedDictModel = create_model_from_typeddict(
|
||||||
typeddict_cls,
|
typeddict_cls,
|
||||||
@ -698,7 +698,7 @@ _VALIDATORS: List[Tuple[Type[Any], List[Any]]] = [
|
|||||||
def find_validators( # noqa: C901 (ignore complexity)
|
def find_validators( # noqa: C901 (ignore complexity)
|
||||||
type_: Type[Any], config: Type['BaseConfig']
|
type_: Type[Any], config: Type['BaseConfig']
|
||||||
) -> Generator[AnyCallable, None, None]:
|
) -> Generator[AnyCallable, None, None]:
|
||||||
from .dataclasses import is_builtin_dataclass, make_dataclass_validator
|
from pydantic.dataclasses import is_builtin_dataclass, make_dataclass_validator
|
||||||
|
|
||||||
if type_ is Any or type_ is object:
|
if type_ is Any or type_ is object:
|
||||||
return
|
return
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
__all__ = 'compiled', 'VERSION', 'version_info'
|
__all__ = 'compiled', 'VERSION', 'version_info'
|
||||||
|
|
||||||
VERSION = '1.10.14'
|
VERSION = '1.10.16'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import cython # type: ignore
|
import cython # type: ignore
|
||||||
|
Loading…
x
Reference in New Issue
Block a user