Skip to content

Commit c9c6b93

Browse files
Update pycrdt v0.8 (#208)
1 parent 05e7ece commit c9c6b93

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

jupyter_ydoc/ynotebook.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Distributed under the terms of the Modified BSD License.
33

44
import copy
5-
import json
65
from functools import partial
76
from typing import Any, Callable, Dict, Optional
87
from uuid import uuid4
@@ -98,8 +97,8 @@ def get_cell(self, index: int) -> Dict[str, Any]:
9897
:return: A cell.
9998
:rtype: Dict[str, Any]
10099
"""
101-
meta = json.loads(str(self._ymeta))
102-
cell = json.loads(str(self._ycells[index]))
100+
meta = self._ymeta.to_py()
101+
cell = self._ycells[index].to_py()
103102
cast_all(cell, float, int) # cells coming from Yjs have e.g. execution_count as float
104103
if "id" in cell and meta["nbformat"] == 4 and meta["nbformat_minor"] <= 4:
105104
# strip cell IDs if we have notebook format 4.0-4.4
@@ -181,7 +180,7 @@ def get(self) -> Dict:
181180
:return: Document's content.
182181
:rtype: Dict
183182
"""
184-
meta = json.loads(str(self._ymeta))
183+
meta = self._ymeta.to_py()
185184
cast_all(meta, float, int) # notebook coming from Yjs has e.g. nbformat as float
186185
cells = []
187186
for i in range(len(self._ycells)):

pyproject.toml

+2-2
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.7.0,<0.8.0",
16+
"pycrdt >=0.8.1,<0.9.0",
1717
]
1818

1919
[[project.authors]]
@@ -31,7 +31,7 @@ test = [
3131
"pytest",
3232
"pytest-asyncio",
3333
"websockets >=10.0",
34-
"pycrdt-websocket >=0.12.5,<0.13.0",
34+
"pycrdt-websocket >=0.12.6,<0.13.0",
3535
]
3636
docs = [
3737
"sphinx",

0 commit comments

Comments
 (0)