From nobody Sun Jul 07 17:23:46 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WHDcg3Mx5z5Q7mm; Sun, 07 Jul 2024 17:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WHDcf748Qz4nxY; Sun, 7 Jul 2024 17:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720373027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oUEa/AqCAiYX5HjtI0A4uBSY1ckW/cOO3wcNUttd0rc=; b=qk92YQtr01/oTByvIqgWUZ6MFyAF+UsAkpVmLEzEohMBWwUx5rcvHfVGAgL/RhNogD5B1X edudzGm/YtLWm1Ws15oUKI2buN6zLNHgo7OOwPsNwlHkKFfKIF9Jg3xyhQwqax5hhSOZHt cPrY+bhy0Agbk8oUKfhYjOGWUXXC4Ji1fCgnOIXBNwBUMr6xeF1OkOA44Hs8aYzHVfIgyh bWStX3Ksf7iwiehJV6om883XEZBzAhDxrAgqizNVj+TBcI4YTc41A5FTb0GarWwfKCfEXN P6/udBO/FQ2v/kFVPtfHDKn3v8TBTp4d/ohaYdBWN6DOaymgZSGPq7jtExa3cA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720373027; a=rsa-sha256; cv=none; b=TnBhX1okUSgEXLMvS/szPED7HnCXmeEamrSoyJipEU/kHIF/x3tdgGDvBZX5iVaLCV4MZl odusaaZNZ62mHZdn2/OdVKiaJM4ZDqDOaEX6xzjGJRt489JZZQ4eXspGEDMEBV8E8cWghW Z/oIPGe3a/UmZ7Z+ZrZtavWkqkN6j1BMdPQKh2u22swckZbYejWrZc91NQnmPCyj5fzsg+ v5W17OtYaUd1RkHmCy85l5P2rqTKipkyuSTDhTeeNGsKf3RvUevf4jK37W/+izIji+rHkG 57A4f79ZwSBBX51kHyB7RbrA8RlZ4sdl6MHRvjGWcy1cXGnJUVELX9UmjM4jyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720373027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oUEa/AqCAiYX5HjtI0A4uBSY1ckW/cOO3wcNUttd0rc=; b=FyCmQ4SlRIsP+uVrRsz5eS82AwSM7mQd/dZhQUeeo9UWXgH25bF7Wnb3PeAae2jKQuucD7 MphYUpbXlerzjDeSLUUMDzVm1Z/942jFCaxhTM15gDxdlAkqDyG1uAOJ9WsG+QGvTzJtSe jDE8ibi2cX9+blF6hHacYrJhEYoA4nqJN94WnILB6H6Y46TSk3Jrd27GvOMFhFNP717TCo YkzJpZgIrPVJZh9rUl5oe1S/o/2QYKSXnHoEhQxblIHU6VOSJFKF4GMo81Atxe2WBGwFgT cmzaumxPELsn2oHzbDrA8qVljFHbo1YGPTyR3lduHOWnGL0v1QzM4R5r3Ih2Cw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WHDcf6fT6zH2s; Sun, 7 Jul 2024 17:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467HNk4k055477; Sun, 7 Jul 2024 17:23:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467HNkg5055474; Sun, 7 Jul 2024 17:23:46 GMT (envelope-from git) Date: Sun, 7 Jul 2024 17:23:46 GMT Message-Id: <202407071723.467HNkg5055474@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: baffb7be56d9 - main - devel/py-jupyter-ydoc: Allow build with py-pycrdt 0.9.0+ List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: baffb7be56d9141bad9fa846a52b3b0d94574a4f Auto-Submitted: auto-generated The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=baffb7be56d9141bad9fa846a52b3b0d94574a4f commit baffb7be56d9141bad9fa846a52b3b0d94574a4f Author: Po-Chuan Hsieh AuthorDate: 2024-07-07 17:20:53 +0000 Commit: Po-Chuan Hsieh CommitDate: 2024-07-07 17:20:53 +0000 devel/py-jupyter-ydoc: Allow build with py-pycrdt 0.9.0+ - Bump PORTREVISION for package change Obtained from: https://github.com/jupyter-server/jupyter_ydoc/commit/803631dc5e771bd441b285373574f573b5c7f664 https://github.com/jupyter-server/jupyter_ydoc/commit/1466ca2f94915876590f802b03c39b69e225d672 https://github.com/jupyter-server/jupyter_ydoc/commit/8e3f25bdcfb8ed36cd740dd958d5d04580cd54ef --- devel/py-jupyter-ydoc/Makefile | 3 +- devel/py-jupyter-ydoc/files/patch-pycrdt | 122 +++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+), 1 deletion(-) diff --git a/devel/py-jupyter-ydoc/Makefile b/devel/py-jupyter-ydoc/Makefile index 0ed67a817456..7fad394ef639 100644 --- a/devel/py-jupyter-ydoc/Makefile +++ b/devel/py-jupyter-ydoc/Makefile @@ -1,5 +1,6 @@ PORTNAME= jupyter-ydoc PORTVERSION= 2.0.1 +PORTREVISION= 1 CATEGORIES= devel python MASTER_SITES= PYPI \ https://github.com/jupyter-server/jupyter_ydoc/releases/download/v${PORTVERSION}/ @@ -16,7 +17,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}hatch-nodejs-version>=0:devel/py-hatch-nodejs-version@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}hatchling>=1.10.0:devel/py-hatchling@${PY_FLAVOR} -RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pycrdt>=0.8.1<0.9.0:devel/py-pycrdt@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pycrdt>=0.9.0<0.10.0:devel/py-pycrdt@${PY_FLAVOR} USES= python USE_PYTHON= autoplist concurrent pep517 diff --git a/devel/py-jupyter-ydoc/files/patch-pycrdt b/devel/py-jupyter-ydoc/files/patch-pycrdt new file mode 100644 index 000000000000..4ddf4e3a153b --- /dev/null +++ b/devel/py-jupyter-ydoc/files/patch-pycrdt @@ -0,0 +1,122 @@ +--- jupyter_ydoc/__init__.py.orig 2020-02-02 00:00:00 UTC ++++ jupyter_ydoc/__init__.py +@@ -3,11 +3,11 @@ import sys + + import sys + +-from ._version import __version__ # noqa +-from .yblob import YBlob # noqa +-from .yfile import YFile # noqa +-from .ynotebook import YNotebook # noqa +-from .yunicode import YUnicode # noqa ++from ._version import __version__ as __version__ ++from .yblob import YBlob as YBlob ++from .yfile import YFile as YFile ++from .ynotebook import YNotebook as YNotebook ++from .yunicode import YUnicode as YUnicode + + # See compatibility note on `group` keyword in + # https://docs.python.org/3/library/importlib.metadata.html#entry-points +--- jupyter_ydoc/ybasedoc.py.orig 2020-02-02 00:00:00 UTC ++++ jupyter_ydoc/ybasedoc.py +@@ -2,9 +2,9 @@ from abc import ABC, abstractmethod + # Distributed under the terms of the Modified BSD License. + + from abc import ABC, abstractmethod +-from typing import Any, Callable, Dict, Optional ++from typing import Any, Callable, Optional + +-from pycrdt import Doc, Map ++from pycrdt import Doc, Map, Subscription, UndoManager + + + class YBaseDoc(ABC): +@@ -15,6 +15,11 @@ class YBaseDoc(ABC): + subscribe to changes in the document. + """ + ++ _ydoc: Doc ++ _ystate: Map ++ _subscriptions: dict[Any, Subscription] ++ _undo_manager: UndoManager ++ + def __init__(self, ydoc: Optional[Doc] = None): + """ + Constructs a YBaseDoc. +@@ -26,8 +31,9 @@ class YBaseDoc(ABC): + self._ydoc = Doc() + else: + self._ydoc = ydoc +- self._ydoc["state"] = self._ystate = Map() +- self._subscriptions: Dict[Any, str] = {} ++ self._ystate = self._ydoc.get("state", type=Map) ++ self._subscriptions = {} ++ self._undo_manager = UndoManager(doc=self._ydoc, capture_timeout_millis=0) + + @property + @abstractmethod +@@ -40,6 +46,15 @@ class YBaseDoc(ABC): + """ + + @property ++ def undo_manager(self) -> UndoManager: ++ """ ++ A :class:`pycrdt.UndoManager` for the document. ++ ++ :return: The document's undo manager. ++ :rtype: :class:`pycrdt.UndoManager` ++ """ ++ return self._undo_manager ++ + def ystate(self) -> Map: + """ + A :class:`pycrdt.Map` containing the state of the document. +--- jupyter_ydoc/yblob.py.orig 2020-02-02 00:00:00 UTC ++++ jupyter_ydoc/yblob.py +@@ -36,7 +36,8 @@ class YBlob(YBaseDoc): + :type ydoc: :class:`pycrdt.Doc`, optional. + """ + super().__init__(ydoc) +- self._ydoc["source"] = self._ysource = Map() ++ self._ysource = self._ydoc.get("source", type=Map) ++ self.undo_manager.expand_scope(self._ysource) + + @property + def version(self) -> str: +--- jupyter_ydoc/ynotebook.py.orig 2020-02-02 00:00:00 UTC ++++ jupyter_ydoc/ynotebook.py +@@ -54,8 +54,9 @@ class YNotebook(YBaseDoc): + :type ydoc: :class:`pycrdt.Doc`, optional. + """ + super().__init__(ydoc) +- self._ydoc["meta"] = self._ymeta = Map() +- self._ydoc["cells"] = self._ycells = Array() ++ self._ymeta = self._ydoc.get("meta", type=Map) ++ self._ycells = self._ydoc.get("cells", type=Array) ++ self.undo_manager.expand_scope(self._ycells) + + @property + def version(self) -> str: +--- jupyter_ydoc/yunicode.py.orig 2020-02-02 00:00:00 UTC ++++ jupyter_ydoc/yunicode.py +@@ -31,7 +31,8 @@ class YUnicode(YBaseDoc): + :type ydoc: :class:`pycrdt.Doc`, optional. + """ + super().__init__(ydoc) +- self._ydoc["source"] = self._ysource = Text() ++ self._ysource = self._ydoc.get("source", type=Text) ++ self.undo_manager.expand_scope(self._ysource) + + @property + def version(self) -> str: +--- pyproject.toml.orig 2020-02-02 00:00:00 UTC ++++ pyproject.toml +@@ -13,7 +13,7 @@ dependencies = [ + keywords = ["jupyter", "ypy"] + dependencies = [ + "importlib_metadata >=3.6; python_version<'3.10'", +- "pycrdt >=0.8.1,<0.9.0", ++ "pycrdt >=0.9.0,<0.10.0", + ] + + [[project.authors]]