Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pycrdt-websocket for openSUSE:Factory checked in at 2024-04-02 16:40:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pycrdt-websocket (Old) and /work/SRC/openSUSE:Factory/.python-pycrdt-websocket.new.1905 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pycrdt-websocket" Tue Apr 2 16:40:48 2024 rev:2 rq:1163598 version:0.12.7 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pycrdt-websocket/python-pycrdt-websocket.changes 2024-01-23 22:55:52.899839133 +0100 +++ /work/SRC/openSUSE:Factory/.python-pycrdt-websocket.new.1905/python-pycrdt-websocket.changes 2024-04-02 16:42:08.072559048 +0200 @@ -1,0 +2,6 @@ +Fri Mar 29 19:37:40 UTC 2024 - Ben Greiner <c...@bnavigator.de> + +- Update to 0.12.7 + * Maintenance and upkeep improvements + +------------------------------------------------------------------- Old: ---- pycrdt_websocket-0.12.6.tar.gz New: ---- pycrdt_websocket-0.12.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pycrdt-websocket.spec ++++++ --- /var/tmp/diff_new_pack.4gN9G7/_old 2024-04-02 16:42:08.584577325 +0200 +++ /var/tmp/diff_new_pack.4gN9G7/_new 2024-04-02 16:42:08.584577325 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-pycrdt-websocket # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python-pycrdt-websocket -Version: 0.12.6 +Version: 0.12.7 Release: 0 Summary: WebSocket connector for pycrdt License: MIT @@ -31,13 +31,13 @@ BuildRequires: python-rpm-macros Requires: python-aiosqlite >= 0.18.0 Requires: python-anyio >= 3.6.2 -Requires: python-pycrdt >= 0.8.1 +Requires: python-pycrdt >= 0.8.7 Provides: python-pycrdt_websocket = %{version}-%{release} BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module aiosqlite >= 0.18.0} BuildRequires: %{python_module anyio >= 3.6.2} -BuildRequires: %{python_module pycrdt >= 0.8.1} +BuildRequires: %{python_module pycrdt >= 0.8.7} BuildRequires: %{python_module pytest-asyncio} BuildRequires: %{python_module pytest} BuildRequires: %{python_module uvicorn} ++++++ pycrdt_websocket-0.12.6.tar.gz -> pycrdt_websocket-0.12.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycrdt_websocket-0.12.6/PKG-INFO new/pycrdt_websocket-0.12.7/PKG-INFO --- old/pycrdt_websocket-0.12.6/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 +++ new/pycrdt_websocket-0.12.7/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pycrdt-websocket -Version: 0.12.6 +Version: 0.12.7 Summary: WebSocket connector for pycrdt Project-URL: Homepage, https://github.com/jupyter-server/pycrdt-websocket Project-URL: Source, https://github.com/jupyter-server/pycrdt-websocket @@ -42,7 +42,7 @@ Requires-Python: >=3.8 Requires-Dist: aiosqlite<1,>=0.18.0 Requires-Dist: anyio<5,>=3.6.2 -Requires-Dist: pycrdt<0.9.0,>=0.8.1 +Requires-Dist: pycrdt<0.9.0,>=0.8.7 Provides-Extra: django Requires-Dist: channels; extra == 'django' Provides-Extra: docs @@ -60,6 +60,8 @@ # Pycrdt-websocket +â ï¸ This project is still in an **incubating** phase (i.e. it's not ready for production yet) â ï¸ + Pycrdt-websocket is an async WebSocket connector for pycrdt. [](https://github.com/jupyter-server/pycrdt-websocket/actions) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycrdt_websocket-0.12.6/README.md new/pycrdt_websocket-0.12.7/README.md --- old/pycrdt_websocket-0.12.6/README.md 2020-02-02 01:00:00.000000000 +0100 +++ new/pycrdt_websocket-0.12.7/README.md 2020-02-02 01:00:00.000000000 +0100 @@ -1,5 +1,7 @@ # Pycrdt-websocket +â ï¸ This project is still in an **incubating** phase (i.e. it's not ready for production yet) â ï¸ + Pycrdt-websocket is an async WebSocket connector for pycrdt. [](https://github.com/jupyter-server/pycrdt-websocket/actions) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycrdt_websocket-0.12.6/pycrdt_websocket/__init__.py new/pycrdt_websocket-0.12.7/pycrdt_websocket/__init__.py --- old/pycrdt_websocket-0.12.6/pycrdt_websocket/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pycrdt_websocket-0.12.7/pycrdt_websocket/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -1,6 +1,7 @@ -from .asgi_server import ASGIServer # noqa -from .websocket_provider import WebsocketProvider # noqa -from .websocket_server import WebsocketServer, YRoom # noqa -from .yutils import YMessageType # noqa +from .asgi_server import ASGIServer as ASGIServer +from .websocket_provider import WebsocketProvider as WebsocketProvider +from .websocket_server import WebsocketServer as WebsocketServer +from .websocket_server import YRoom as YRoom +from .yutils import YMessageType as YMessageType -__version__ = "0.12.6" +__version__ = "0.12.7" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycrdt_websocket-0.12.6/pycrdt_websocket/asgi_server.py new/pycrdt_websocket-0.12.7/pycrdt_websocket/asgi_server.py --- old/pycrdt_websocket-0.12.6/pycrdt_websocket/asgi_server.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pycrdt_websocket-0.12.7/pycrdt_websocket/asgi_server.py 2020-02-02 01:00:00.000000000 +0100 @@ -64,7 +64,8 @@ Arguments: websocket_server: An instance of WebsocketServer. - on_connect: An optional callback to call when connecting the WebSocket. If the callback returns True, the WebSocket is not accepted. + on_connect: An optional callback to call when connecting the WebSocket. + If the callback returns True, the WebSocket is not accepted. on_disconnect: An optional callback called when disconnecting the WebSocket. """ self._websocket_server = websocket_server diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycrdt_websocket-0.12.6/pycrdt_websocket/django_channels_consumer.py new/pycrdt_websocket-0.12.7/pycrdt_websocket/django_channels_consumer.py --- old/pycrdt_websocket-0.12.6/pycrdt_websocket/django_channels_consumer.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pycrdt_websocket-0.12.7/pycrdt_websocket/django_channels_consumer.py 2020-02-02 01:00:00.000000000 +0100 @@ -3,7 +3,7 @@ from logging import getLogger from typing import TypedDict -from channels.generic.websocket import AsyncWebsocketConsumer # type: ignore +from channels.generic.websocket import AsyncWebsocketConsumer # type: ignore[import-not-found] from pycrdt import Doc from .websocket import Websocket diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycrdt_websocket-0.12.6/pycrdt_websocket/websocket.py new/pycrdt_websocket-0.12.7/pycrdt_websocket/websocket.py --- old/pycrdt_websocket-0.12.6/pycrdt_websocket/websocket.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pycrdt_websocket-0.12.7/pycrdt_websocket/websocket.py 2020-02-02 01:00:00.000000000 +0100 @@ -1,15 +1,11 @@ -import sys - -if sys.version_info >= (3, 8): - from typing import Protocol -else: - from typing_extensions import Protocol +from typing import Protocol class Websocket(Protocol): """WebSocket. - The Websocket instance can receive messages using an async iterator, until the connection is closed: + The Websocket instance can receive messages using an async iterator, + until the connection is closed: ```py async for message in websocket: ... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycrdt_websocket-0.12.6/pycrdt_websocket/websocket_server.py new/pycrdt_websocket-0.12.7/pycrdt_websocket/websocket_server.py --- old/pycrdt_websocket-0.12.6/pycrdt_websocket/websocket_server.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pycrdt_websocket-0.12.7/pycrdt_websocket/websocket_server.py 2020-02-02 01:00:00.000000000 +0100 @@ -80,7 +80,8 @@ """ if self._task_group is None: raise RuntimeError( - "The WebsocketServer is not running: use `async with websocket_server:` or `await websocket_server.start()`" + "The WebsocketServer is not running: use `async with websocket_server:` or " + "`await websocket_server.start()`" ) if not room.started.is_set(): @@ -137,7 +138,8 @@ """ if self._task_group is None: raise RuntimeError( - "The WebsocketServer is not running: use `async with websocket_server:` or `await websocket_server.start()`" + "The WebsocketServer is not running: use `async with websocket_server:` or " + "`await websocket_server.start()`" ) async with create_task_group() as tg: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycrdt_websocket-0.12.6/pycrdt_websocket/yroom.py new/pycrdt_websocket-0.12.7/pycrdt_websocket/yroom.py --- old/pycrdt_websocket-0.12.6/pycrdt_websocket/yroom.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pycrdt_websocket-0.12.7/pycrdt_websocket/yroom.py 2020-02-02 01:00:00.000000000 +0100 @@ -114,7 +114,8 @@ def on_message(self, value: Callable[[bytes], Awaitable[bool] | bool] | None): """ Arguments: - value: An optional callback to call when a message is received. If the callback returns True, the message is skipped. + value: An optional callback to call when a message is received. + If the callback returns True, the message is skipped. """ self._on_message = value @@ -221,7 +222,8 @@ ) for client in self.clients: self.log.debug( - "Sending Y awareness from client with endpoint %s to client with endpoint: %s", + "Sending Y awareness from client with endpoint " + "%s to client with endpoint: %s", websocket.path, client.path, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycrdt_websocket-0.12.6/pycrdt_websocket/ystore.py new/pycrdt_websocket-0.12.7/pycrdt_websocket/ystore.py --- old/pycrdt_websocket-0.12.6/pycrdt_websocket/ystore.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pycrdt_websocket-0.12.7/pycrdt_websocket/ystore.py 2020-02-02 01:00:00.000000000 +0100 @@ -41,8 +41,9 @@ ... @abstractmethod - async def read(self) -> AsyncIterator[tuple[bytes, bytes]]: - ... + async def read(self) -> AsyncIterator[tuple[bytes, bytes, float]]: + if False: + yield @property def started(self) -> Event: @@ -125,7 +126,7 @@ Arguments: ydoc: The YDoc on which to apply the updates. """ - async for update, *rest in self.read(): # type: ignore + async for update, *rest in self.read(): ydoc.apply_update(update) @@ -179,16 +180,16 @@ move_file = True if move_file: new_path = await get_new_path(self.path) - self.log.warning(f"YStore version mismatch, moving {self.path} to {new_path}") + self.log.warning("YStore version mismatch, moving %s to %s", self.path, new_path) await anyio.Path(self.path).rename(new_path) if version_mismatch: async with await anyio.open_file(self.path, "wb") as f: - version_bytes = f"VERSION:{self.version}\n".encode() # noqa + version_bytes = f"VERSION:{self.version}\n".encode() await f.write(version_bytes) offset = len(version_bytes) return offset - async def read(self) -> AsyncIterator[tuple[bytes, bytes, float]]: # type: ignore + async def read(self) -> AsyncIterator[tuple[bytes, bytes, float]]: """Async iterator for reading the store content. Returns: @@ -350,7 +351,8 @@ async with self.lock: async with aiosqlite.connect(self.db_path) as db: cursor = await db.execute( - "SELECT count(name) FROM sqlite_master WHERE type='table' and name='yupdates'" + "SELECT count(name) FROM sqlite_master " + "WHERE type='table' and name='yupdates'" ) table_exists = (await cursor.fetchone())[0] if table_exists: @@ -363,13 +365,14 @@ create_db = True if move_db: new_path = await get_new_path(self.db_path) - self.log.warning(f"YStore version mismatch, moving {self.db_path} to {new_path}") + self.log.warning("YStore version mismatch, moving %s to %s", self.db_path, new_path) await anyio.Path(self.db_path).rename(new_path) if create_db: async with self.lock: async with aiosqlite.connect(self.db_path) as db: await db.execute( - "CREATE TABLE yupdates (path TEXT NOT NULL, yupdate BLOB, metadata BLOB, timestamp REAL NOT NULL)" + "CREATE TABLE yupdates (path TEXT NOT NULL, yupdate BLOB, " + "metadata BLOB, timestamp REAL NOT NULL)" ) await db.execute( "CREATE INDEX idx_yupdates_path_timestamp ON yupdates (path, timestamp)" @@ -378,7 +381,7 @@ await db.commit() self.db_initialized.set() - async def read(self) -> AsyncIterator[tuple[bytes, bytes, float]]: # type: ignore + async def read(self) -> AsyncIterator[tuple[bytes, bytes, float]]: """Async iterator for reading the store content. Returns: @@ -412,7 +415,8 @@ async with aiosqlite.connect(self.db_path) as db: # first, determine time elapsed since last update cursor = await db.execute( - "SELECT timestamp FROM yupdates WHERE path = ? ORDER BY timestamp DESC LIMIT 1", + "SELECT timestamp FROM yupdates WHERE path = ? " + "ORDER BY timestamp DESC LIMIT 1", (self.path,), ) row = await cursor.fetchone() @@ -424,7 +428,7 @@ 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,)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycrdt_websocket-0.12.6/pycrdt_websocket/yutils.py new/pycrdt_websocket-0.12.7/pycrdt_websocket/yutils.py --- old/pycrdt_websocket-0.12.6/pycrdt_websocket/yutils.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pycrdt_websocket-0.12.7/pycrdt_websocket/yutils.py 2020-02-02 01:00:00.000000000 +0100 @@ -78,7 +78,7 @@ if length == 0: return b"" i1 = self.i0 + length - message = self.stream[self.i0 : i1] # noqa + message = self.stream[self.i0 : i1] self.i0 = i1 self.length -= length return message @@ -99,7 +99,7 @@ def put_updates(update_send_stream: MemoryObjectSendStream, event: TransactionEvent) -> None: try: - update = event.update # type: ignore + update = event.update update_send_stream.send_nowait(update) except Exception: pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycrdt_websocket-0.12.6/pyproject.toml new/pycrdt_websocket-0.12.7/pyproject.toml --- old/pycrdt_websocket-0.12.6/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 +++ new/pycrdt_websocket-0.12.7/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 @@ -30,7 +30,7 @@ dependencies = [ "anyio >=3.6.2,<5", "aiosqlite >=0.18.0,<1", - "pycrdt >=0.8.1,<0.9.0", + "pycrdt >=0.8.7,<0.9.0", ] [project.optional-dependencies] @@ -66,14 +66,15 @@ "/tests", ] -[tool.flake8] -ignore = "E501, W503, E402" -exclude = [ - ".github", -] -enable-extensions = "G" -extend-ignore = [ - "G001", "G002", "G004", "G200", "G201", "G202", - # black adds spaces around ':' - "E203", +[tool.ruff] +line-length = 99 +select = [ + "ASYNC", # flake8-async + "E", "F", "W", # default Flake8 + "G", # flake8-logging-format + "I", # isort + "ISC", # flake8-implicit-str-concat + "PGH", # pygrep-hooks + "RUF100", # unused noqa (yesqa) + "UP", # pyupgrade ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycrdt_websocket-0.12.6/tests/conftest.py new/pycrdt_websocket-0.12.7/tests/conftest.py --- old/pycrdt_websocket-0.12.6/tests/conftest.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pycrdt_websocket-0.12.7/tests/conftest.py 2020-02-02 01:00:00.000000000 +0100 @@ -2,7 +2,7 @@ import pytest from pycrdt import Array, Doc -from websockets import serve # type: ignore +from websockets import serve from pycrdt_websocket import WebsocketServer diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycrdt_websocket-0.12.6/tests/test_asgi.py new/pycrdt_websocket-0.12.7/tests/test_asgi.py --- old/pycrdt_websocket-0.12.6/tests/test_asgi.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pycrdt_websocket-0.12.7/tests/test_asgi.py 2020-02-02 01:00:00.000000000 +0100 @@ -2,7 +2,7 @@ import uvicorn from anyio import create_task_group, sleep from pycrdt import Doc, Map -from websockets import connect # type: ignore +from websockets import connect from pycrdt_websocket import ASGIServer, WebsocketProvider, WebsocketServer @@ -26,14 +26,14 @@ ydoc1["map"] = ymap1 = Map() ymap1["key"] = "value" async with connect( - f"ws://localhost:{unused_tcp_port}/my-roomname" # noqa + f"ws://localhost:{unused_tcp_port}/my-roomname" ) as websocket1, WebsocketProvider(ydoc1, websocket1): await sleep(0.1) # client 2 ydoc2 = Doc() async with connect( - f"ws://localhost:{unused_tcp_port}/my-roomname" # noqa + f"ws://localhost:{unused_tcp_port}/my-roomname" ) as websocket2, WebsocketProvider(ydoc2, websocket2): await sleep(0.1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pycrdt_websocket-0.12.6/tests/test_pycrdt_yjs.py new/pycrdt_websocket-0.12.7/tests/test_pycrdt_yjs.py --- old/pycrdt_websocket-0.12.6/tests/test_pycrdt_yjs.py 2020-02-02 01:00:00.000000000 +0100 +++ new/pycrdt_websocket-0.12.7/tests/test_pycrdt_yjs.py 2020-02-02 01:00:00.000000000 +0100 @@ -1,7 +1,7 @@ import pytest from anyio import Event, create_task_group, move_on_after, sleep from pycrdt import Array, Doc, Map -from websockets import connect # type: ignore +from websockets import connect from pycrdt_websocket import WebsocketProvider