Skip to content

Commit

Permalink
Changes:
Browse files Browse the repository at this point in the history
- bump dependency to python 3.9 and remove cruft
- update typings
  • Loading branch information
devkral committed Oct 9, 2024
1 parent 8f5ac2a commit 01a12df
Show file tree
Hide file tree
Showing 30 changed files with 1,029 additions and 1,114 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

services:
mariadb:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Databasez is suitable for integrating against any async Web framework, such as [
[Starlette][starlette], [Sanic][sanic], [Responder][responder], [Quart][quart], [aiohttp][aiohttp],
[Tornado][tornado], or [FastAPI][fastapi].

Databasez was built for Python 3.8+ and on the top of the newest **SQLAlchemy 2** and gives you
Databasez was built for Python 3.9+ and on the top of the newest **SQLAlchemy 2** and gives you
simple asyncio support for a range of databases.

### Special notes
Expand Down
17 changes: 9 additions & 8 deletions databasez/core/asgi.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
from __future__ import annotations

from collections.abc import Awaitable, Callable
from contextlib import suppress
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Dict
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
from databasez.core.Database import Database

ASGIApp = Callable[
[
Dict[str, Any],
Callable[[], Awaitable[Dict[str, Any]]],
Callable[[Dict[str, Any]], Awaitable[None]],
dict[str, Any],
Callable[[], Awaitable[dict[str, Any]]],
Callable[[dict[str, Any]], Awaitable[None]],
],
Awaitable[None],
]
Expand All @@ -29,14 +30,14 @@ class ASGIHelper:

async def __call__(
self,
scope: Dict[str, Any],
receive: Callable[[], Awaitable[Dict[str, Any]]],
send: Callable[[Dict[str, Any]], Awaitable[None]],
scope: dict[str, Any],
receive: Callable[[], Awaitable[dict[str, Any]]],
send: Callable[[dict[str, Any]], Awaitable[None]],
) -> None:
if scope["type"] == "lifespan":
original_receive = receive

async def receive() -> Dict[str, Any]:
async def receive() -> dict[str, Any]:
message = await original_receive()
if message["type"] == "lifespan.startup":
try:
Expand Down
Loading

0 comments on commit 01a12df

Please sign in to comment.