From efc03a10c346bca7a77763d229f9906396ff7d03 Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Mon, 2 Oct 2023 15:00:41 +0200 Subject: [PATCH] update pydantic version --- CHANGES.md | 4 ++++ pyproject.toml | 2 +- tipg/settings.py | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index dcd0d229..eeb6d82a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,10 @@ Note: Minor version `0.X.0` update might break the API, It's recommended to pin - replace `string_to_table(...)` by `unnest(string_to_array(...))` to support Postgres<14 +### changed + +- update pydantic minimum version to >=2.4 + ## [0.4.3] - 2023-08-28 ### fixed diff --git a/pyproject.toml b/pyproject.toml index ef364f2c..68731fdf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ dependencies = [ "fastapi>=0.100.0", "jinja2>=2.11.2,<4.0.0", "morecantile>=5.0,<6.0", - "pydantic~=2.0", + "pydantic>=2.4,<3.0", "pydantic-settings~=2.0", "geojson-pydantic>=1.0,<2.0", "pygeofilter>=0.2.0,<0.3.0", diff --git a/tipg/settings.py b/tipg/settings.py index c8fc88a3..6e374708 100644 --- a/tipg/settings.py +++ b/tipg/settings.py @@ -6,8 +6,8 @@ from pydantic import ( DirectoryPath, Field, - FieldValidationInfo, PostgresDsn, + ValidationInfo, field_validator, model_validator, ) @@ -132,7 +132,7 @@ class PostgresSettings(BaseSettings): # https://github.com/tiangolo/full-stack-fastapi-postgresql/blob/master/%7B%7Bcookiecutter.project_slug%7D%7D/backend/app/app/core/config.py#L42 @field_validator("database_url", mode="before") def assemble_db_connection( - cls, v: Optional[str], info: FieldValidationInfo + cls, v: Optional[str], info: ValidationInfo ) -> PostgresDsn: """Validate db url settings.""" if isinstance(v, str):