Skip to content

Commit

Permalink
Upgrade pydantic version to >=2.5.2 (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
hramezani authored Dec 14, 2023
1 parent e0b1256 commit 0ce9f20
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ lint:

.PHONY: mypy
mypy:
mypy pydantic_extra_types --disable-recursive-aliases
mypy pydantic_extra_types

.PHONY: pyupgrade
pyupgrade:
Expand Down
2 changes: 1 addition & 1 deletion pydantic_extra_types/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)

Expand Down
10 changes: 5 additions & 5 deletions pydantic_extra_types/country.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion pydantic_extra_types/mac_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
Expand Down
2 changes: 1 addition & 1 deletion pydantic_extra_types/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pydantic_extra_types/phone_numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
Expand Down
2 changes: 1 addition & 1 deletion pydantic_extra_types/routing_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ classifiers = [
]
requires-python = '>=3.7'
dependencies = [
'pydantic>=2.0.3',
'pydantic>=2.5.2',
]
dynamic = ['version']

Expand Down
4 changes: 2 additions & 2 deletions requirements/pyproject.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0ce9f20

Please sign in to comment.