Skip to content

Commit

Permalink
Merge pull request #42 from tarsil/fix/nested_asyncio
Browse files Browse the repository at this point in the history
Removed nested_asyncio
  • Loading branch information
tarsil authored Apr 24, 2023
2 parents d90539f + 954574a commit dc28f54
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 6 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes

## 0.7.4

### Fixed

- Removed `nested_asyncio` causing infinite loops.

## 0.7.3

### Added
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion saffier/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.7.3"
__version__ = "0.7.4"

from saffier.conf import settings
from saffier.conf.global_settings import SaffierSettings
Expand Down
1 change: 0 additions & 1 deletion saffier/core/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions saffier/db/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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:
Expand Down
3 changes: 0 additions & 3 deletions saffier/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import functools
import typing

import nest_asyncio
import sqlalchemy
from sqlalchemy.engine import Engine

Expand All @@ -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"""
Expand Down

0 comments on commit dc28f54

Please sign in to comment.