From 4c1390aad0bbb85dbb552810b5c519fd0ccb9bf0 Mon Sep 17 00:00:00 2001 From: pylakey Date: Fri, 22 Sep 2023 14:29:12 +0800 Subject: [PATCH] Update version and add Pydantic v2 support check The package version has been updated from 0.21.0 to 0.22.0 in "__init__.py" and in "pyproject.toml" files. Given the potential compatibility issues, a check has been added and an exception is raised in "__init__.py" if Pydantic version 2 is being used, as Aiotdlib currently does not support it. Pydantic library version in the project dependency has been updated to not include version 3. --- aiotdlib/__init__.py | 7 ++++++- pyproject.toml | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/aiotdlib/__init__.py b/aiotdlib/__init__.py index bdc3683..a6aae6a 100644 --- a/aiotdlib/__init__.py +++ b/aiotdlib/__init__.py @@ -1,4 +1,9 @@ -__version__ = "0.21.0" +__version__ = "0.22.0" + +import pydantic + +if pydantic.VERSION.startswith("2"): + raise NotImplementedError("Aiotdlib currently does not support Pydantic V2") from .client import ( Client, diff --git a/pyproject.toml b/pyproject.toml index 6084b8c..ac9114a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "aiotdlib" -version = "0.21.0" +version = "0.22.0" description = "Python asyncio Telegram client based on TDLib" authors = ["pylakey "] license = "MIT" @@ -27,7 +27,7 @@ classifiers = [ [tool.poetry.dependencies] python = "^3.9" -pydantic = "^1.9.1" +pydantic = ">=1.9.1,<3" sortedcontainers = "^2.4.0" ujson = "^5.4.0"