From e7596c73e82850e3c6490f419866365bdfdbe9d3 Mon Sep 17 00:00:00 2001 From: Varjitt Jeeva Date: Thu, 9 Nov 2023 14:25:48 -0500 Subject: [PATCH] feat: support for Pydantic v2+ --- pgbelt/config/models.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pgbelt/config/models.py b/pgbelt/config/models.py index c2904d01..7467381c 100644 --- a/pgbelt/config/models.py +++ b/pgbelt/config/models.py @@ -142,7 +142,7 @@ async def save(self): pass async with aopen(self.file, "w") as f: - await f.write(self.json(indent=4)) + await f.write(self.model_dump_json(indent=4)) logger.info("Cached config to disk.") diff --git a/pyproject.toml b/pyproject.toml index 29589ce9..d3412de7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ packages = [ python = ">=3.9,<4.0" aiofiles = ">=0.8,<23.3" asyncpg = ">=0.27,<0.30" -pydantic = ">=1.10,<3.0" +pydantic = ">=2.0,<3.0" tabulate = "^0.9.0" typer = "^0.9.0"