Skip to content

Commit 1f14f00

Browse files
committed
Update pycrdt and pycrdt-websocket
1 parent 4881b9d commit 1f14f00

File tree

7 files changed

+9
-15
lines changed

7 files changed

+9
-15
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ jobs:
5252
run: |
5353
mamba install pip nodejs=18
5454
pip install ".[test]"
55-
pip install https://github.com/davidbrochart/ypy-websocket/archive/pycrdt.zip
5655
5756
- name: Build JavaScript assets
5857
working-directory: javascript

jupyter_ydoc/ybasedoc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ def __init__(self, ydoc: Optional[Doc] = None):
2626
self._ydoc = Doc()
2727
else:
2828
self._ydoc = ydoc
29-
self._ystate = Map()
30-
self._ydoc["state"] = self._ystate
29+
self._ydoc["state"] = self._ystate = Map()
3130
self._subscriptions: Dict[Any, str] = {}
3231

3332
@property

jupyter_ydoc/yblob.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ def __init__(self, ydoc: Optional[Doc] = None):
3636
:type ydoc: :class:`pycrdt.Doc`, optional.
3737
"""
3838
super().__init__(ydoc)
39-
self._ysource = Map()
40-
self._ydoc["source"] = self._ysource
39+
self._ydoc["source"] = self._ysource = Map()
4140

4241
@property
4342
def version(self) -> str:

jupyter_ydoc/ynotebook.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ def __init__(self, ydoc: Optional[Doc] = None):
5555
:type ydoc: :class:`pycrdt.Doc`, optional.
5656
"""
5757
super().__init__(ydoc)
58-
self._ymeta = Map()
59-
self._ycells = Array()
60-
self._ydoc["meta"] = self._ymeta
61-
self._ydoc["cells"] = self._ycells
58+
self._ydoc["meta"] = self._ymeta = Map()
59+
self._ydoc["cells"] = self._ycells = Array()
6260

6361
@property
6462
def version(self) -> str:

jupyter_ydoc/yunicode.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ def __init__(self, ydoc: Optional[Doc] = None):
3131
:type ydoc: :class:`pycrdt.Doc`, optional.
3232
"""
3333
super().__init__(ydoc)
34-
self._ysource = Text()
35-
self._ydoc["source"] = self._ysource
34+
self._ydoc["source"] = self._ysource = Text()
3635

3736
@property
3837
def version(self) -> str:
@@ -62,7 +61,7 @@ def set(self, value: str) -> None:
6261
"""
6362
with self._ydoc.transaction():
6463
# clear document
65-
del self._ysource[:]
64+
self._ysource.clear()
6665
# initialize document
6766
if value:
6867
self._ysource += value

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ requires-python = ">=3.7"
1313
keywords = ["jupyter", "ypy"]
1414
dependencies = [
1515
"importlib_metadata >=3.6; python_version<'3.10'",
16-
"pycrdt >=0.3.4,<0.4.0",
16+
"pycrdt >=0.7.0,<0.8.0",
1717
]
1818

1919
[[project.authors]]
@@ -31,6 +31,7 @@ test = [
3131
"pytest",
3232
"pytest-asyncio",
3333
"websockets >=10.0",
34+
"pycrdt-websocket >=0.12.5,<0.13.0",
3435
]
3536
docs = [
3637
"sphinx",

tests/test_ypy_yjs.py renamed to tests/test_pycrdt_yjs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ def stringify_source(nb: dict) -> dict:
2929
class YTest:
3030
def __init__(self, ydoc: Doc, timeout: float = 1.0):
3131
self.timeout = timeout
32-
self.ytest = Map()
33-
ydoc["_test"] = self.ytest
32+
ydoc["_test"] = self.ytest = Map()
3433
self.clock = -1.0
3534

3635
def run_clock(self):

0 commit comments

Comments
 (0)