diff --git a/Makefile b/Makefile index 4379d7d8..a9b1bc71 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ lint: .PHONY: mypy mypy: - mypy pydantic_extra_types --disable-recursive-aliases + mypy pydantic_extra_types .PHONY: pyupgrade pyupgrade: diff --git a/pydantic_extra_types/color.py b/pydantic_extra_types/color.py index 63e3b00a..8010df87 100644 --- a/pydantic_extra_types/color.py +++ b/pydantic_extra_types/color.py @@ -243,7 +243,7 @@ def _alpha_float(self) -> float: def __get_pydantic_core_schema__( cls, source: type[Any], handler: Callable[[Any], CoreSchema] ) -> core_schema.CoreSchema: - return core_schema.general_plain_validator_function( + return core_schema.with_info_plain_validator_function( cls._validate, serialization=core_schema.to_string_ser_schema() ) diff --git a/pydantic_extra_types/country.py b/pydantic_extra_types/country.py index c930db1f..a32fa60a 100644 --- a/pydantic_extra_types/country.py +++ b/pydantic_extra_types/country.py @@ -95,7 +95,7 @@ def _validate(cls, __input_value: str, _: core_schema.ValidationInfo) -> Country def __get_pydantic_core_schema__( cls, source: type[Any], handler: GetCoreSchemaHandler ) -> core_schema.AfterValidatorFunctionSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls._validate, core_schema.str_schema(to_upper=True), ) @@ -158,7 +158,7 @@ def _validate(cls, __input_value: str, _: core_schema.ValidationInfo) -> Country def __get_pydantic_core_schema__( cls, source: type[Any], handler: GetCoreSchemaHandler ) -> core_schema.AfterValidatorFunctionSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls._validate, core_schema.str_schema(to_upper=True), serialization=core_schema.to_string_ser_schema(), @@ -222,7 +222,7 @@ def _validate(cls, __input_value: str, _: core_schema.ValidationInfo) -> Country def __get_pydantic_core_schema__( cls, source: type[Any], handler: GetCoreSchemaHandler ) -> core_schema.AfterValidatorFunctionSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls._validate, core_schema.str_schema(to_upper=True), serialization=core_schema.to_string_ser_schema(), @@ -285,7 +285,7 @@ def _validate(cls, __input_value: str, _: core_schema.ValidationInfo) -> Country def __get_pydantic_core_schema__( cls, source: type[Any], handler: GetCoreSchemaHandler ) -> core_schema.AfterValidatorFunctionSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls._validate, core_schema.str_schema(), serialization=core_schema.to_string_ser_schema(), @@ -340,7 +340,7 @@ def _validate(cls, __input_value: str, _: core_schema.ValidationInfo) -> Country def __get_pydantic_core_schema__( cls, source: type[Any], handler: GetCoreSchemaHandler ) -> core_schema.AfterValidatorFunctionSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls._validate, core_schema.str_schema(), serialization=core_schema.to_string_ser_schema(), diff --git a/pydantic_extra_types/mac_address.py b/pydantic_extra_types/mac_address.py index 15648e0e..78ff0a39 100644 --- a/pydantic_extra_types/mac_address.py +++ b/pydantic_extra_types/mac_address.py @@ -32,7 +32,7 @@ class Network(BaseModel): @classmethod def __get_pydantic_core_schema__(cls, source: type[Any], handler: GetCoreSchemaHandler) -> core_schema.CoreSchema: - return core_schema.general_before_validator_function( + return core_schema.with_info_before_validator_function( cls._validate, core_schema.str_schema(), ) diff --git a/pydantic_extra_types/payment.py b/pydantic_extra_types/payment.py index a3bfa73a..c451aab0 100644 --- a/pydantic_extra_types/payment.py +++ b/pydantic_extra_types/payment.py @@ -52,7 +52,7 @@ def __init__(self, card_number: str): @classmethod def __get_pydantic_core_schema__(cls, source: type[Any], handler: GetCoreSchemaHandler) -> core_schema.CoreSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls.validate, core_schema.str_schema( min_length=cls.min_length, max_length=cls.max_length, strip_whitespace=cls.strip_whitespace diff --git a/pydantic_extra_types/phone_numbers.py b/pydantic_extra_types/phone_numbers.py index f776cdc4..7acaa898 100644 --- a/pydantic_extra_types/phone_numbers.py +++ b/pydantic_extra_types/phone_numbers.py @@ -51,7 +51,7 @@ def __get_pydantic_json_schema__( @classmethod def __get_pydantic_core_schema__(cls, source: type[Any], handler: GetCoreSchemaHandler) -> core_schema.CoreSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls._validate, core_schema.str_schema(min_length=cls.min_length, max_length=cls.max_length), ) diff --git a/pydantic_extra_types/routing_number.py b/pydantic_extra_types/routing_number.py index e2b083a9..22ea6e88 100644 --- a/pydantic_extra_types/routing_number.py +++ b/pydantic_extra_types/routing_number.py @@ -41,7 +41,7 @@ def __init__(self, routing_number: str): def __get_pydantic_core_schema__( cls, source: Type[Any], handler: GetCoreSchemaHandler ) -> core_schema.AfterValidatorFunctionSchema: - return core_schema.general_after_validator_function( + return core_schema.with_info_after_validator_function( cls._validate, core_schema.str_schema( min_length=cls.min_length, diff --git a/pyproject.toml b/pyproject.toml index 8c812181..8a7e998c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ classifiers = [ ] requires-python = '>=3.7' dependencies = [ - 'pydantic>=2.0.3', + 'pydantic>=2.5.2', ] dynamic = ['version'] diff --git a/requirements/pyproject.txt b/requirements/pyproject.txt index 070df2cf..7f70390d 100644 --- a/requirements/pyproject.txt +++ b/requirements/pyproject.txt @@ -10,9 +10,9 @@ phonenumbers==8.13.13 # via pydantic-extra-types (pyproject.toml) pycountry==22.3.5 # via pydantic-extra-types (pyproject.toml) -pydantic==2.0.3 +pydantic==2.5.2 # via pydantic-extra-types (pyproject.toml) -pydantic-core==2.3.0 +pydantic-core==2.14.5 # via pydantic python-ulid==1.1.0 # via pydantic-extra-types (pyproject.toml)