Skip to content

Commit e441c6e

Browse files
authored
Bump y-py to 0.6.0+ (#175)
* Bump y-py to 0.6.0+ * Fix doc generation
1 parent 3744d45 commit e441c6e

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ from jupyter_ydoc import YFile, YNotebook
3434
The `"jupyter_ydoc"` entry point group can be populated with your own documents, e.g. by adding the
3535
following to your package's `setup.cfg`:
3636

37-
```
37+
```ini
3838
[options.entry_points]
3939
jupyter_ydoc =
4040
my_document = my_package.my_file:MyDocumentClass

jupyter_ydoc/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) Jupyter Development Team.
2+
# Distributed under the terms of the Modified BSD License.
3+
14
import sys
25

36
from ._version import __version__ # noqa

jupyter_ydoc/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) Jupyter Development Team.
2+
# Distributed under the terms of the Modified BSD License.
3+
14
from typing import Dict, List, Type, Union
25

36
INT = Type[int]

jupyter_ydoc/ydoc.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
# Copyright (c) Jupyter Development Team.
2+
# Distributed under the terms of the Modified BSD License.
3+
14
import copy
5+
import json
26
from typing import Any, Dict
37
from uuid import uuid4
48

@@ -93,8 +97,8 @@ def __init__(self, *args, **kwargs):
9397
self._ycells = self._ydoc.get_array("cells")
9498

9599
def get_cell(self, index: int) -> Dict[str, Any]:
96-
meta = self._ymeta.to_json()
97-
cell = self._ycells[index].to_json()
100+
meta = json.loads(self._ymeta.to_json())
101+
cell = json.loads(self._ycells[index].to_json())
98102
cast_all(cell, float, int) # cells coming from Yjs have e.g. execution_count as float
99103
if "id" in cell and meta["nbformat"] == 4 and meta["nbformat_minor"] <= 4:
100104
# strip cell IDs if we have notebook format 4.0-4.4
@@ -145,7 +149,7 @@ def set_ycell(self, index: int, ycell: Y.YMap, txn=None):
145149
self._ycells.insert(txn, index, ycell)
146150

147151
def get(self):
148-
meta = self._ymeta.to_json()
152+
meta = json.loads(self._ymeta.to_json())
149153
cast_all(meta, float, int) # notebook coming from Yjs has e.g. nbformat as float
150154
cells = []
151155
for i in range(len(self._ycells)):

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ requires-python = ">=3.7"
1010
keywords = ["jupyter", "ypy"]
1111
dependencies = [
1212
"importlib_metadata >=3.6; python_version<\"3.10\"",
13-
"y-py >=0.5.3,<0.6.0",
13+
"y-py >=0.6.0,<0.7.0",
1414
]
1515

1616
[[project.authors]]
@@ -23,7 +23,7 @@ test = [
2323
"pytest",
2424
"pytest-asyncio",
2525
"websockets >=10.0",
26-
"ypy-websocket >=0.3.1,<0.4.0",
26+
"ypy-websocket >=0.8.4,<0.9.0",
2727
]
2828
dev = [
2929
"click",

0 commit comments

Comments
 (0)