jupyter-server-ydoc 1.0.0b0__tar.gz → 1.0.0b2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/PKG-INFO +2 -2
- jupyter_server_ydoc-1.0.0b2/jupyter_server_ydoc/_version.py +1 -0
- jupyter_server_ydoc-1.0.0b0/tests/conftest.py → jupyter_server_ydoc-1.0.0b2/jupyter_server_ydoc/pytest_plugin.py +19 -10
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/pyproject.toml +1 -1
- jupyter_server_ydoc-1.0.0b2/tests/conftest.py +8 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/tests/test_app.py +21 -2
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/tests/test_loaders.py +1 -2
- jupyter_server_ydoc-1.0.0b0/jupyter_server_ydoc/_version.py +0 -1
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/.gitignore +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/LICENSE +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/README.md +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/jupyter-config/jupyter_server_ydoc.json +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/jupyter_server_ydoc/__init__.py +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/jupyter_server_ydoc/app.py +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/jupyter_server_ydoc/events/awareness.yaml +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/jupyter_server_ydoc/events/session.yaml +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/jupyter_server_ydoc/handlers.py +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/jupyter_server_ydoc/loaders.py +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/jupyter_server_ydoc/rooms.py +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/jupyter_server_ydoc/stores.py +0 -0
- /jupyter_server_ydoc-1.0.0b0/tests/utils.py → /jupyter_server_ydoc-1.0.0b2/jupyter_server_ydoc/test_utils.py +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/jupyter_server_ydoc/utils.py +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/jupyter_server_ydoc/websocketserver.py +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/setup.py +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/tests/__init__.py +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/tests/test_documents.py +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/tests/test_handlers.py +0 -0
- {jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/tests/test_rooms.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: jupyter-server-ydoc
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.0b2
|
|
4
4
|
Summary: jupyter-server extension integrating collaborative shared models.
|
|
5
5
|
Author-email: Jupyter Development Team <jupyter@googlegroups.com>
|
|
6
6
|
License: # Licensing terms
|
|
@@ -79,7 +79,7 @@ Requires-Dist: jsonschema>=4.18.0
|
|
|
79
79
|
Requires-Dist: jupyter-events>=0.10.0
|
|
80
80
|
Requires-Dist: jupyter-server-fileid<1,>=0.7.0
|
|
81
81
|
Requires-Dist: jupyter-server<3.0.0,>=2.4.0
|
|
82
|
-
Requires-Dist: jupyter-ydoc<
|
|
82
|
+
Requires-Dist: jupyter-ydoc<4.0.0,>=2.0.0
|
|
83
83
|
Requires-Dist: pycrdt
|
|
84
84
|
Requires-Dist: pycrdt-websocket<0.15.0,>=0.14.0
|
|
85
85
|
Provides-Extra: test
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.0.0b2"
|
|
@@ -16,9 +16,7 @@ from jupyter_ydoc import YNotebook, YUnicode
|
|
|
16
16
|
from pycrdt_websocket import WebsocketProvider
|
|
17
17
|
from websockets import connect
|
|
18
18
|
|
|
19
|
-
from .
|
|
20
|
-
|
|
21
|
-
pytest_plugins = ["jupyter_server.pytest_plugin", "jupyter_server_fileid.pytest_plugin"]
|
|
19
|
+
from .test_utils import FakeContentsManager, FakeEventLogger, FakeFileIDManager
|
|
22
20
|
|
|
23
21
|
|
|
24
22
|
@pytest.fixture
|
|
@@ -30,7 +28,10 @@ def rtc_document_save_delay():
|
|
|
30
28
|
def jp_server_config(jp_root_dir, jp_server_config, rtc_document_save_delay):
|
|
31
29
|
return {
|
|
32
30
|
"ServerApp": {
|
|
33
|
-
"jpserver_extensions": {
|
|
31
|
+
"jpserver_extensions": {
|
|
32
|
+
"jupyter_server_ydoc": True,
|
|
33
|
+
"jupyter_server_fileid": True,
|
|
34
|
+
},
|
|
34
35
|
"token": "",
|
|
35
36
|
"password": "",
|
|
36
37
|
"disable_check_xsrf": True,
|
|
@@ -148,11 +149,12 @@ def rtc_connect_doc_client(jp_http_port, jp_base_url, rtc_fetch_session):
|
|
|
148
149
|
def rtc_add_doc_to_store(rtc_connect_doc_client):
|
|
149
150
|
event = Event()
|
|
150
151
|
|
|
151
|
-
def _on_document_change(target: str, e: Any) -> None:
|
|
152
|
-
if target == "source":
|
|
153
|
-
event.set()
|
|
154
|
-
|
|
155
152
|
async def _inner(format: str, type: str, path: str) -> None:
|
|
153
|
+
def _on_document_change(target: str, e: Any) -> None:
|
|
154
|
+
expected_target = "cells" if type == "notebook" else "source"
|
|
155
|
+
if target == expected_target:
|
|
156
|
+
event.set()
|
|
157
|
+
|
|
156
158
|
if type == "notebook":
|
|
157
159
|
doc = YNotebook()
|
|
158
160
|
else:
|
|
@@ -172,7 +174,7 @@ def rtc_add_doc_to_store(rtc_connect_doc_client):
|
|
|
172
174
|
def rtc_create_SQLite_store_factory(jp_serverapp):
|
|
173
175
|
async def _inner(type: str, path: str, content: str) -> DocumentRoom:
|
|
174
176
|
db = SQLiteYStore(path=f"{type}:{path}", config=jp_serverapp.config)
|
|
175
|
-
|
|
177
|
+
_ = create_task(db.start())
|
|
176
178
|
await db.started.wait()
|
|
177
179
|
|
|
178
180
|
if type == "notebook":
|
|
@@ -221,7 +223,14 @@ def rtc_create_mock_document_room():
|
|
|
221
223
|
cm,
|
|
222
224
|
loader,
|
|
223
225
|
DocumentRoom(
|
|
224
|
-
"test-room",
|
|
226
|
+
"test-room",
|
|
227
|
+
"text",
|
|
228
|
+
"file",
|
|
229
|
+
loader,
|
|
230
|
+
FakeEventLogger(),
|
|
231
|
+
store,
|
|
232
|
+
None,
|
|
233
|
+
save_delay,
|
|
225
234
|
),
|
|
226
235
|
)
|
|
227
236
|
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
6
|
+
import nbformat
|
|
6
7
|
import pytest
|
|
8
|
+
from jupyter_server_ydoc.pytest_plugin import rtc_create_SQLite_store_factory
|
|
7
9
|
from jupyter_server_ydoc.stores import SQLiteYStore, TempFileYStore
|
|
8
10
|
|
|
9
|
-
from .conftest import rtc_create_SQLite_store_factory
|
|
10
|
-
|
|
11
11
|
|
|
12
12
|
def test_default_settings(jp_serverapp):
|
|
13
13
|
settings = jp_serverapp.web_app.settings["jupyter_server_ydoc_config"]
|
|
@@ -88,6 +88,25 @@ async def test_get_document_file(rtc_create_file, jp_serverapp, copy):
|
|
|
88
88
|
await collaboration.stop_extension()
|
|
89
89
|
|
|
90
90
|
|
|
91
|
+
@pytest.mark.parametrize("copy", [True, False])
|
|
92
|
+
async def test_get_document_notebook(rtc_create_notebook, jp_serverapp, copy):
|
|
93
|
+
nb = nbformat.v4.new_notebook(
|
|
94
|
+
cells=[nbformat.v4.new_code_cell(source="1+1", execution_count=99)]
|
|
95
|
+
)
|
|
96
|
+
nb_content = nbformat.writes(nb, version=4)
|
|
97
|
+
path, _ = await rtc_create_notebook("test.ipynb", nb_content, store=True)
|
|
98
|
+
collaboration = jp_serverapp.web_app.settings["jupyter_server_ydoc"]
|
|
99
|
+
document = await collaboration.get_document(
|
|
100
|
+
path=path, content_type="notebook", file_format="json", copy=copy
|
|
101
|
+
)
|
|
102
|
+
doc = document.get()
|
|
103
|
+
assert len(doc["cells"]) == 1
|
|
104
|
+
cell = doc["cells"][0]
|
|
105
|
+
assert cell["source"] == "1+1"
|
|
106
|
+
assert cell["execution_count"] == 99
|
|
107
|
+
await collaboration.stop_extension()
|
|
108
|
+
|
|
109
|
+
|
|
91
110
|
async def test_get_document_file_copy_is_independent(
|
|
92
111
|
rtc_create_file, jp_serverapp, rtc_fetch_session
|
|
93
112
|
):
|
|
@@ -7,8 +7,7 @@ import asyncio
|
|
|
7
7
|
from datetime import datetime, timedelta, timezone
|
|
8
8
|
|
|
9
9
|
from jupyter_server_ydoc.loaders import FileLoader, FileLoaderMapping
|
|
10
|
-
|
|
11
|
-
from .utils import FakeContentsManager, FakeFileIDManager
|
|
10
|
+
from jupyter_server_ydoc.test_utils import FakeContentsManager, FakeFileIDManager
|
|
12
11
|
|
|
13
12
|
|
|
14
13
|
async def test_FileLoader_with_watcher():
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.0.0b0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/jupyter-config/jupyter_server_ydoc.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/jupyter_server_ydoc/events/session.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{jupyter_server_ydoc-1.0.0b0 → jupyter_server_ydoc-1.0.0b2}/jupyter_server_ydoc/websocketserver.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|