Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-ypy-websocket for openSUSE:Factory checked in at 2023-06-13 16:09:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-ypy-websocket (Old) and /work/SRC/openSUSE:Factory/.python-ypy-websocket.new.15902 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ypy-websocket" Tue Jun 13 16:09:46 2023 rev:2 rq:1092708 version:0.8.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-ypy-websocket/python-ypy-websocket.changes 2023-03-24 15:20:41.546972834 +0100 +++ /work/SRC/openSUSE:Factory/.python-ypy-websocket.new.15902/python-ypy-websocket.changes 2023-06-13 16:09:50.163000808 +0200 @@ -1,0 +2,10 @@ +Sun Jun 11 21:15:50 UTC 2023 - Ben Greiner <c...@bnavigator.de> + +- Update to 0.8.4 + * Keep reference to asyncio tasks #69 (@davidbrochart) +- Release 0.8.3 + * Bump y-py >=0.6.0,<0.7.0 #68 (@davidbrochart) + * Move pytest.ini entries to pyproject.toml #64 (@bnavigator) + * Compare dicts not JSON string with dicts #63 (@bnavigator) + +------------------------------------------------------------------- Old: ---- ypy_websocket-0.8.2.tar.gz New: ---- ypy_websocket-0.8.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-ypy-websocket.spec ++++++ --- /var/tmp/diff_new_pack.pQroMF/_old 2023-06-13 16:09:50.907005197 +0200 +++ /var/tmp/diff_new_pack.pQroMF/_new 2023-06-13 16:09:50.911005221 +0200 @@ -17,8 +17,8 @@ Name: python-ypy-websocket -# Don't update until the dep chain for jupyterlab can handle newer versions -Version: 0.8.2 +# Don't update until the dep chain for jupyterlab can handle newer versions (python-jupyter-ydoc) +Version: 0.8.4 Release: 0 Summary: WebSocket connector for Ypy License: MIT @@ -32,7 +32,7 @@ BuildRequires: python-rpm-macros Requires: python-aiofiles >= 22.1.0 Requires: (python-aiosqlite >= 0.17.0 with python-aiosqlite < 1) -Requires: (python-y-py >= 0.5.3 with python-y-py < 0.6.0) +Requires: (python-y-py >= 0.6 with python-y-py < 0.7) BuildArch: noarch # SECTION test BuildRequires: %{python_module aiofiles >= 22.1.0} @@ -40,7 +40,7 @@ BuildRequires: %{python_module pytest-asyncio} BuildRequires: %{python_module pytest} BuildRequires: %{python_module websockets >= 10.0} -BuildRequires: %{python_module y-py >= 0.5.3 with %python-y-py < 0.6.0} +BuildRequires: %{python_module y-py >= 0.6 with %python-y-py < 0.7} BuildRequires: nodejs # /SECTION %python_subpackages @@ -61,7 +61,7 @@ %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%pytest --asyncio-mode auto +%pytest %files %{python_files} %doc README.md ++++++ node_modules.tar.xz ++++++ ++++ 25779 lines of diff (skipped) ++++++ ypy_websocket-0.8.2.tar.gz -> ypy_websocket-0.8.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ypy_websocket-0.8.2/PKG-INFO new/ypy_websocket-0.8.4/PKG-INFO --- old/ypy_websocket-0.8.2/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 +++ new/ypy_websocket-0.8.4/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: ypy-websocket -Version: 0.8.2 +Version: 0.8.4 Summary: WebSocket connector for Ypy Project-URL: Homepage, https://github.com/y-crdt/ypy-websocket Author-email: David Brochart <david.broch...@gmail.com> @@ -9,7 +9,7 @@ Requires-Python: >=3.7 Requires-Dist: aiofiles<23,>=22.1.0 Requires-Dist: aiosqlite<1,>=0.17.0 -Requires-Dist: y-py<0.6.0,>=0.5.3 +Requires-Dist: y-py<0.7.0,>=0.6.0 Provides-Extra: test Requires-Dist: mypy; extra == 'test' Requires-Dist: pre-commit; extra == 'test' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ypy_websocket-0.8.2/pyproject.toml new/ypy_websocket-0.8.4/pyproject.toml --- old/ypy_websocket-0.8.2/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 +++ new/ypy_websocket-0.8.4/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 @@ -7,7 +7,6 @@ dynamic = ["version"] description = "WebSocket connector for Ypy" readme = "README.md" -license = "MIT" requires-python = ">=3.7" authors = [ { name = "David Brochart", email = "david.broch...@gmail.com" }, @@ -19,7 +18,7 @@ dependencies = [ "aiofiles >=22.1.0,<23", "aiosqlite >=0.17.0,<1", - "y-py >=0.5.3,<0.6.0", + "y-py >=0.6.0,<0.7.0", ] [project.optional-dependencies] @@ -54,3 +53,6 @@ # black adds spaces around ':' "E203", ] + +[tool.pytest.ini_options] +asyncio_mode = "auto" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ypy_websocket-0.8.2/tests/test_ypy_yjs.py new/ypy_websocket-0.8.4/tests/test_ypy_yjs.py --- old/ypy_websocket-0.8.2/tests/test_ypy_yjs.py 2020-02-02 01:00:00.000000000 +0100 +++ new/ypy_websocket-0.8.4/tests/test_ypy_yjs.py 2020-02-02 01:00:00.000000000 +0100 @@ -1,4 +1,5 @@ import asyncio +import json import pytest import y_py as Y @@ -70,5 +71,5 @@ await ytest.clock_run() ycells = ydoc.get_array("cells") ystate = ydoc.get_map("state") - assert ycells.to_json() == [{"metadata": {"foo": "bar"}, "source": "1 + 2"}] - assert ystate.to_json() == {"state": {"dirty": False}} + assert json.loads(ycells.to_json()) == [{"metadata": {"foo": "bar"}, "source": "1 + 2"}] + assert json.loads(ystate.to_json()) == {"state": {"dirty": False}} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ypy_websocket-0.8.2/ypy_websocket/__init__.py new/ypy_websocket-0.8.4/ypy_websocket/__init__.py --- old/ypy_websocket-0.8.2/ypy_websocket/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/ypy_websocket-0.8.4/ypy_websocket/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -2,4 +2,4 @@ from .websocket_server import WebsocketServer, YRoom # noqa from .yutils import YMessageType # noqa -__version__ = "0.8.2" +__version__ = "0.8.4" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ypy_websocket-0.8.2/ypy_websocket/websocket_provider.py new/ypy_websocket-0.8.4/ypy_websocket/websocket_provider.py --- old/ypy_websocket-0.8.2/ypy_websocket/websocket_provider.py 2020-02-02 01:00:00.000000000 +0100 +++ new/ypy_websocket-0.8.4/ypy_websocket/websocket_provider.py 2020-02-02 01:00:00.000000000 +0100 @@ -24,7 +24,7 @@ self.log = log or logging.getLogger(__name__) self._update_queue = asyncio.Queue() ydoc.observe_after_transaction(partial(put_updates, self._update_queue, ydoc)) - asyncio.create_task(self._run()) + self._run_task = asyncio.create_task(self._run()) async def _run(self): await sync(self._ydoc, self._websocket, self.log) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ypy_websocket-0.8.2/ypy_websocket/websocket_server.py new/ypy_websocket-0.8.4/ypy_websocket/websocket_server.py --- old/ypy_websocket-0.8.2/ypy_websocket/websocket_server.py 2020-02-02 01:00:00.000000000 +0100 +++ new/ypy_websocket-0.8.4/ypy_websocket/websocket_server.py 2020-02-02 01:00:00.000000000 +0100 @@ -1,7 +1,7 @@ import asyncio import logging from functools import partial -from typing import Callable, Dict, List, Optional +from typing import Callable, Dict, List, Optional, Set import y_py as Y @@ -18,6 +18,7 @@ class YRoom: + background_tasks: Set[asyncio.Task] clients: List ydoc: Y.YDoc ystore: Optional[BaseYStore] @@ -36,6 +37,7 @@ self.clients = [] self._on_message = None self._broadcast_task = asyncio.create_task(self._broadcast_updates()) + self.background_tasks = set() @property def ready(self) -> bool: @@ -63,10 +65,14 @@ for client in self.clients: self.log.debug("Sending Y update to client with endpoint: %s", client.path) message = create_update_message(update) - asyncio.create_task(client.send(message)) + task = asyncio.create_task(client.send(message)) + self.background_tasks.add(task) + task.add_done_callback(self.background_tasks.discard) if self.ystore: self.log.debug("Writing Y update to YStore") - asyncio.create_task(self.ystore.write(update)) + task = asyncio.create_task(self.ystore.write(update)) + self.background_tasks.add(task) + task.add_done_callback(self.background_tasks.discard) def _clean(self): self._broadcast_task.cancel() @@ -75,6 +81,7 @@ class WebsocketServer: auto_clean_rooms: bool + background_tasks: Set[asyncio.Task] rooms: Dict[str, YRoom] def __init__(self, rooms_ready: bool = True, auto_clean_rooms: bool = True, log=None): @@ -82,6 +89,7 @@ self.auto_clean_rooms = auto_clean_rooms self.log = log or logging.getLogger(__name__) self.rooms = {} + self.background_tasks = set() def get_room(self, path: str) -> YRoom: if path not in self.rooms.keys(): @@ -125,9 +133,11 @@ # update our internal state in the background # changes to the internal state are then forwarded to all clients # and stored in the YStore (if any) - asyncio.create_task( + task = asyncio.create_task( process_sync_message(message[1:], room.ydoc, websocket, self.log) ) + self.background_tasks.add(task) + task.add_done_callback(self.background_tasks.discard) elif message_type == YMessageType.AWARENESS: # forward awareness messages from this client to all clients, # including itself, because it's used to keep the connection alive @@ -142,7 +152,9 @@ websocket.path, client.path, ) - asyncio.create_task(client.send(message)) + task = asyncio.create_task(client.send(message)) + self.background_tasks.add(task) + task.add_done_callback(self.background_tasks.discard) # remove this client room.clients = [c for c in room.clients if c != websocket] if self.auto_clean_rooms and not room.clients: