Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #9

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
args: ["--line-length", "100"]
Expand Down
5 changes: 3 additions & 2 deletions pycrdt_websocket/asgi_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ class ASGIServer:
def __init__(
self,
websocket_server: WebsocketServer,
on_connect: Callable[[dict[str, Any], dict[str, Any]], Awaitable[bool] | bool]
| None = None,
on_connect: (
Callable[[dict[str, Any], dict[str, Any]], Awaitable[bool] | bool] | None
) = None,
on_disconnect: Callable[[dict[str, Any]], Awaitable[None] | None] | None = None,
):
"""Initialize the object.
Expand Down
11 changes: 4 additions & 7 deletions pycrdt_websocket/ystore.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,13 @@ class BaseYStore(ABC):
@abstractmethod
def __init__(
self, path: str, metadata_callback: Callable[[], Awaitable[bytes] | bytes] | None = None
):
...
): ...

@abstractmethod
async def write(self, data: bytes) -> None:
...
async def write(self, data: bytes) -> None: ...

@abstractmethod
async def read(self) -> AsyncIterator[tuple[bytes, bytes]]:
...
async def read(self) -> AsyncIterator[tuple[bytes, bytes]]: ...

@property
def started(self) -> Event:
Expand Down Expand Up @@ -424,7 +421,7 @@ async def write(self, data: bytes) -> None:
async with db.execute(
"SELECT yupdate FROM yupdates WHERE path = ?", (self.path,)
) as cursor:
async for update, in cursor:
async for (update,) in cursor:
ydoc.apply_update(update)
# delete history
await db.execute("DELETE FROM yupdates WHERE path = ?", (self.path,))
Expand Down
Loading