diff --git a/docs/release-notes.md b/docs/release-notes.md index 3feb2aa..4676ed2 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,5 +1,11 @@ # Release Notes +## 0.7.4 + +### Fixed + +- Removed `nested_asyncio` causing infinite loops. + ## 0.7.3 ### Added diff --git a/pyproject.toml b/pyproject.toml index 8a8936b..9ac0202 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,11 +43,9 @@ dependencies = [ "click>=8.1.3,<9.0.0", "loguru>=0.6.0,<0.7.0", "databasez>=0.2.0", - "nest_asyncio>=1.5.6,<2.0.0", "orjson >=3.8.5,<4.0.0", "pydantic>=1.10.5,<2.0.0", "rich>=13.3.1,<14.0.0", - "sqlalchemy>=2.0.8,<2.1", ] keywords = [ "api", diff --git a/saffier/__init__.py b/saffier/__init__.py index a7a2d16..7336c99 100644 --- a/saffier/__init__.py +++ b/saffier/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.7.3" +__version__ = "0.7.4" from saffier.conf import settings from saffier.conf.global_settings import SaffierSettings diff --git a/saffier/core/registry.py b/saffier/core/registry.py index 52759b4..c767b89 100644 --- a/saffier/core/registry.py +++ b/saffier/core/registry.py @@ -86,5 +86,4 @@ async def drop_all(self) -> None: async with self.database: async with self.engine.begin() as conn: await conn.run_sync(self.metadata.drop_all) - await self.engine.dispose() diff --git a/saffier/db/fields.py b/saffier/db/fields.py index 53d0ef1..37f75ca 100644 --- a/saffier/db/fields.py +++ b/saffier/db/fields.py @@ -359,7 +359,7 @@ def check(self, value: typing.Any) -> typing.Any: if self.null and self.coerce_types: return None raise self.validation_error("required") - raise self.validation_error(("required")) + raise self.validation_error("required") return value @@ -393,7 +393,7 @@ def __init__(self, any_of: typing.List[SaffierField], **kwargs: typing.Any): super().__init__(**kwargs) self.any_of = any_of - if any([child.null for child in any_of]): + if any(child.null for child in any_of): self.allow_null = True def check(self, value: typing.Any) -> typing.Any: diff --git a/saffier/models.py b/saffier/models.py index 365d8e7..a94f424 100644 --- a/saffier/models.py +++ b/saffier/models.py @@ -2,7 +2,6 @@ import functools import typing -import nest_asyncio import sqlalchemy from sqlalchemy.engine import Engine @@ -13,8 +12,6 @@ from saffier.exceptions import ImproperlyConfigured from saffier.metaclass import MetaInfo, ModelMeta, ReflectMeta -nest_asyncio.apply() - def async_adapter(wrapped_func): """Adapter to run async functions inside the blocking"""