Skip to content

Commit 544b1dc

Browse files
Update with ypy v0.6.0 (#145)
* Update with ypy v0.6.0 * Bump ypy-websocket >=0.8.3 in test dependencies
1 parent c9db1e7 commit 544b1dc

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

jupyter_ydoc/ynotebook.py

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

44
import copy
5+
import json
56
from functools import partial
67
from typing import Any, Callable, Dict, Optional
78
from uuid import uuid4
@@ -87,8 +88,8 @@ def get_cell(self, index: int) -> Dict[str, Any]:
8788
:return: A cell.
8889
:rtype: Dict[str, Any]
8990
"""
90-
meta = self._ymeta.to_json()
91-
cell = self._ycells[index].to_json()
91+
meta = json.loads(self._ymeta.to_json())
92+
cell = json.loads(self._ycells[index].to_json())
9293
cast_all(cell, float, int) # cells coming from Yjs have e.g. execution_count as float
9394
if "id" in cell and meta["nbformat"] == 4 and meta["nbformat_minor"] <= 4:
9495
# strip cell IDs if we have notebook format 4.0-4.4
@@ -191,7 +192,7 @@ def get(self) -> Dict:
191192
:return: Document's content.
192193
:rtype: Dict
193194
"""
194-
meta = self._ymeta.to_json()
195+
meta = json.loads(self._ymeta.to_json())
195196
cast_all(meta, float, int) # notebook coming from Yjs has e.g. nbformat as float
196197
cells = []
197198
for i in range(len(self._ycells)):

pyproject.toml

Lines changed: 2 additions & 2 deletions
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-
"y-py >=0.5.3,<0.6.0",
16+
"y-py >=0.6.0,<0.7.0",
1717
]
1818

1919
[[project.authors]]
@@ -31,7 +31,7 @@ test = [
3131
"pytest",
3232
"pytest-asyncio",
3333
"websockets >=10.0",
34-
"ypy-websocket >=0.3.1,<0.4.0",
34+
"ypy-websocket >=0.8.3,<0.9.0",
3535
]
3636
docs = [
3737
"sphinx",

0 commit comments

Comments
 (0)