jupyter-ydoc 3.0.0a8__tar.gz → 3.0.0a10__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.
Files changed (44) hide show
  1. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/.pre-commit-config.yaml +2 -2
  2. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/CHANGELOG.md +32 -2
  3. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/PKG-INFO +3 -3
  4. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/javascript/package.json +1 -1
  5. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/jupyter_ydoc/_version.py +1 -1
  6. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/jupyter_ydoc/ybasedoc.py +7 -2
  7. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/jupyter_ydoc/yblob.py +6 -3
  8. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/jupyter_ydoc/ynotebook.py +17 -4
  9. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/jupyter_ydoc/yunicode.py +6 -3
  10. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/pyproject.toml +2 -2
  11. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/.github/dependabot.yml +0 -0
  12. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/.github/workflows/auto_author_assign.yml +0 -0
  13. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/.github/workflows/check-release.yml +0 -0
  14. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/.github/workflows/enforce-label.yml +0 -0
  15. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/.github/workflows/license-header.yml +0 -0
  16. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/.github/workflows/prep-release.yml +0 -0
  17. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/.github/workflows/publish-release.yml +0 -0
  18. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/.github/workflows/test.yml +0 -0
  19. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/.gitignore +0 -0
  20. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/.licenserc.yaml +0 -0
  21. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/.yarn/releases/yarn-3.4.1.cjs +0 -0
  22. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/.yarnrc.yml +0 -0
  23. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/LICENSE +0 -0
  24. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/README.md +0 -0
  25. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/docs/Makefile +0 -0
  26. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/docs/make.bat +0 -0
  27. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/docs/source/_static/jupyter_logo.svg +0 -0
  28. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/docs/source/_static/logo-icon.png +0 -0
  29. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/docs/source/conf.py +0 -0
  30. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/docs/source/custom.md +0 -0
  31. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/docs/source/index.md +0 -0
  32. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/docs/source/javascript_api.rst +0 -0
  33. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/docs/source/overview.md +0 -0
  34. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/docs/source/python_api.rst +0 -0
  35. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/docs/source/schema.md +0 -0
  36. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/jupyter_ydoc/__init__.py +0 -0
  37. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/jupyter_ydoc/py.typed +0 -0
  38. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/jupyter_ydoc/utils.py +0 -0
  39. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/jupyter_ydoc/yfile.py +0 -0
  40. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/lerna.json +0 -0
  41. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/package.json +0 -0
  42. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/pytest.ini +0 -0
  43. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/readthedocs.yml +0 -0
  44. {jupyter_ydoc-3.0.0a8 → jupyter_ydoc-3.0.0a10}/yarn.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  repos:
2
2
  - repo: https://github.com/pre-commit/pre-commit-hooks
3
- rev: v4.6.0
3
+ rev: v5.0.0
4
4
  hooks:
5
5
  - id: end-of-file-fixer
6
6
  - id: check-case-conflict
@@ -17,7 +17,7 @@ repos:
17
17
  exclude: ^\.yarn
18
18
 
19
19
  - repo: https://github.com/astral-sh/ruff-pre-commit
20
- rev: v0.6.7
20
+ rev: v0.6.9
21
21
  hooks:
22
22
  - id: ruff
23
23
  args: [--fix, --show-fixes]
@@ -2,6 +2,38 @@
2
2
 
3
3
  <!-- <START NEW CHANGELOG ENTRY> -->
4
4
 
5
+ ## 3.0.0a10
6
+
7
+ ([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@3.0.0-a9...dc71f641f72826232772509a8c9cea474d7ccc9f))
8
+
9
+ ### Maintenance and upkeep improvements
10
+
11
+ - Revert #266 [#280](https://github.com/jupyter-server/jupyter_ydoc/pull/280) ([@davidbrochart](https://github.com/davidbrochart))
12
+
13
+ ### Contributors to this release
14
+
15
+ ([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2024-10-10&to=2024-10-17&type=c))
16
+
17
+ [@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2024-10-10..2024-10-17&type=Issues)
18
+
19
+ <!-- <END NEW CHANGELOG ENTRY> -->
20
+
21
+ ## 3.0.0a9
22
+
23
+ ([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@3.0.0-a8...877e5b9bb449b6f4e2472337e41f27c3bf24ead1))
24
+
25
+ ### Enhancements made
26
+
27
+ - Doc awareness [#277](https://github.com/jupyter-server/jupyter_ydoc/pull/277) ([@brichet](https://github.com/brichet))
28
+
29
+ ### Maintenance and upkeep improvements
30
+
31
+ ### Contributors to this release
32
+
33
+ ([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2024-09-26&to=2024-10-10&type=c))
34
+
35
+ [@brichet](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Abrichet+updated%3A2024-09-26..2024-10-10&type=Issues) | [@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2024-09-26..2024-10-10&type=Issues) | [@lumberbot-app](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Alumberbot-app+updated%3A2024-09-26..2024-10-10&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Apre-commit-ci+updated%3A2024-09-26..2024-10-10&type=Issues)
36
+
5
37
  ## 3.0.0a8
6
38
 
7
39
  ([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@3.0.0-a7...b20878676d4564641ac142804eaf27331ddb342c))
@@ -20,8 +52,6 @@
20
52
 
21
53
  [@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2024-09-18..2024-09-26&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Apre-commit-ci+updated%3A2024-09-18..2024-09-26&type=Issues)
22
54
 
23
- <!-- <END NEW CHANGELOG ENTRY> -->
24
-
25
55
  ## 3.0.0a7
26
56
 
27
57
  ([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@3.0.0-a6...3f323117ba2e8cf36f0e06c0ec9b9fa2c192278b))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: jupyter-ydoc
3
- Version: 3.0.0a8
3
+ Version: 3.0.0a10
4
4
  Summary: Document structures for collaborative editing using Ypy
5
5
  Project-URL: Homepage, https://jupyter.org
6
6
  Project-URL: Source, https://github.com/jupyter-server/jupyter_ydoc
@@ -10,7 +10,7 @@ License-File: LICENSE
10
10
  Keywords: jupyter,pycrdt,yjs
11
11
  Requires-Python: >=3.8
12
12
  Requires-Dist: importlib-metadata>=3.6; python_version < '3.10'
13
- Requires-Dist: pycrdt<0.10.0,>=0.9.0
13
+ Requires-Dist: pycrdt<0.11.0,>=0.10.1
14
14
  Provides-Extra: dev
15
15
  Requires-Dist: click; extra == 'dev'
16
16
  Requires-Dist: jupyter-releaser; extra == 'dev'
@@ -21,7 +21,7 @@ Requires-Dist: pydata-sphinx-theme; extra == 'docs'
21
21
  Requires-Dist: sphinx; extra == 'docs'
22
22
  Provides-Extra: test
23
23
  Requires-Dist: pre-commit; extra == 'test'
24
- Requires-Dist: pycrdt-websocket<0.15.0,>=0.14.1; extra == 'test'
24
+ Requires-Dist: pycrdt-websocket<0.16.0,>=0.15.0; extra == 'test'
25
25
  Requires-Dist: pytest; extra == 'test'
26
26
  Requires-Dist: pytest-asyncio; extra == 'test'
27
27
  Requires-Dist: websockets>=10.0; extra == 'test'
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyter/ydoc",
3
- "version": "3.0.0-a8",
3
+ "version": "3.0.0-a10",
4
4
  "type": "module",
5
5
  "description": "Jupyter document structures for collaborative editing using YJS",
6
6
  "homepage": "https://github.com/jupyter-server/jupyter_ydoc",
@@ -1,4 +1,4 @@
1
1
  # This file is auto-generated by Hatchling. As such, do not:
2
2
  # - modify
3
3
  # - track in version control e.g. be sure to add to .gitignore
4
- __version__ = VERSION = '3.0.0a8'
4
+ __version__ = VERSION = '3.0.0a10'
@@ -4,7 +4,7 @@
4
4
  from abc import ABC, abstractmethod
5
5
  from typing import Any, Callable, Dict, Optional
6
6
 
7
- from pycrdt import Doc, Map, Subscription, UndoManager
7
+ from pycrdt import Awareness, Doc, Map, Subscription, UndoManager
8
8
 
9
9
 
10
10
  class YBaseDoc(ABC):
@@ -20,17 +20,22 @@ class YBaseDoc(ABC):
20
20
  _subscriptions: Dict[Any, Subscription]
21
21
  _undo_manager: UndoManager
22
22
 
23
- def __init__(self, ydoc: Optional[Doc] = None):
23
+ def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] = None):
24
24
  """
25
25
  Constructs a YBaseDoc.
26
26
 
27
27
  :param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided.
28
28
  :type ydoc: :class:`pycrdt.Doc`, optional.
29
+ :param awareness: The :class:`pycrdt.Awareness` that shares non persistent data
30
+ between clients.
31
+ :type awareness: :class:`pycrdt.Awareness`, optional.
29
32
  """
30
33
  if ydoc is None:
31
34
  self._ydoc = Doc()
32
35
  else:
33
36
  self._ydoc = ydoc
37
+ self.awareness = awareness
38
+
34
39
  self._ystate = self._ydoc.get("state", type=Map)
35
40
  self._subscriptions = {}
36
41
  self._undo_manager = UndoManager(doc=self._ydoc, capture_timeout_millis=0)
@@ -4,7 +4,7 @@
4
4
  from functools import partial
5
5
  from typing import Any, Callable, Optional
6
6
 
7
- from pycrdt import Doc, Map
7
+ from pycrdt import Awareness, Doc, Map
8
8
 
9
9
  from .ybasedoc import YBaseDoc
10
10
 
@@ -24,14 +24,17 @@ class YBlob(YBaseDoc):
24
24
  }
25
25
  """
26
26
 
27
- def __init__(self, ydoc: Optional[Doc] = None):
27
+ def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] = None):
28
28
  """
29
29
  Constructs a YBlob.
30
30
 
31
31
  :param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided.
32
32
  :type ydoc: :class:`pycrdt.Doc`, optional.
33
+ :param awareness: The :class:`pycrdt.Awareness` that shares non persistent data
34
+ between clients.
35
+ :type awareness: :class:`pycrdt.Awareness`, optional.
33
36
  """
34
- super().__init__(ydoc)
37
+ super().__init__(ydoc, awareness)
35
38
  self._ysource = self._ydoc.get("source", type=Map)
36
39
  self.undo_manager.expand_scope(self._ysource)
37
40
 
@@ -6,7 +6,7 @@ from functools import partial
6
6
  from typing import Any, Callable, Dict, Optional
7
7
  from uuid import uuid4
8
8
 
9
- from pycrdt import Array, Doc, Map, Text
9
+ from pycrdt import Array, Awareness, Doc, Map, Text
10
10
 
11
11
  from .utils import cast_all
12
12
  from .ybasedoc import YBaseDoc
@@ -47,14 +47,17 @@ class YNotebook(YBaseDoc):
47
47
  }
48
48
  """
49
49
 
50
- def __init__(self, ydoc: Optional[Doc] = None):
50
+ def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] = None):
51
51
  """
52
52
  Constructs a YNotebook.
53
53
 
54
54
  :param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided.
55
55
  :type ydoc: :class:`pycrdt.Doc`, optional.
56
+ :param awareness: The :class:`pycrdt.Awareness` that shares non persistent data
57
+ between clients.
58
+ :type awareness: :class:`pycrdt.Awareness`, optional.
56
59
  """
57
- super().__init__(ydoc)
60
+ super().__init__(ydoc, awareness)
58
61
  self._ymeta = self._ydoc.get("meta", type=Map)
59
62
  self._ycells = self._ydoc.get("cells", type=Array)
60
63
  self.undo_manager.expand_scope(self._ycells)
@@ -222,7 +225,17 @@ class YNotebook(YBaseDoc):
222
225
  nb_without_cells = {key: value[key] for key in value.keys() if key != "cells"}
223
226
  nb = copy.deepcopy(nb_without_cells)
224
227
  cast_all(nb, int, float) # Yjs expects numbers to be floating numbers
225
- cells = value["cells"]
228
+ cells = value["cells"] or [
229
+ {
230
+ "cell_type": "code",
231
+ "execution_count": None,
232
+ # auto-created empty code cell without outputs ought be trusted
233
+ "metadata": {"trusted": True},
234
+ "outputs": [],
235
+ "source": "",
236
+ "id": str(uuid4()),
237
+ }
238
+ ]
226
239
 
227
240
  with self._ydoc.transaction():
228
241
  # clear document
@@ -4,7 +4,7 @@
4
4
  from functools import partial
5
5
  from typing import Any, Callable, Optional
6
6
 
7
- from pycrdt import Doc, Text
7
+ from pycrdt import Awareness, Doc, Text
8
8
 
9
9
  from .ybasedoc import YBaseDoc
10
10
 
@@ -23,14 +23,17 @@ class YUnicode(YBaseDoc):
23
23
  }
24
24
  """
25
25
 
26
- def __init__(self, ydoc: Optional[Doc] = None):
26
+ def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] = None):
27
27
  """
28
28
  Constructs a YUnicode.
29
29
 
30
30
  :param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided.
31
31
  :type ydoc: :class:`pycrdt.Doc`, optional.
32
+ :param awareness: The :class:`pycrdt.Awareness` that shares non persistent data
33
+ between clients.
34
+ :type awareness: :class:`pycrdt.Awareness`, optional.
32
35
  """
33
- super().__init__(ydoc)
36
+ super().__init__(ydoc, awareness)
34
37
  self._ysource = self._ydoc.get("source", type=Text)
35
38
  self.undo_manager.expand_scope(self._ysource)
36
39
 
@@ -13,7 +13,7 @@ requires-python = ">=3.8"
13
13
  keywords = ["jupyter", "pycrdt", "yjs"]
14
14
  dependencies = [
15
15
  "importlib_metadata >=3.6; python_version<'3.10'",
16
- "pycrdt >=0.9.0,<0.10.0",
16
+ "pycrdt >=0.10.1,<0.11.0",
17
17
  ]
18
18
 
19
19
  [[project.authors]]
@@ -31,7 +31,7 @@ test = [
31
31
  "pytest",
32
32
  "pytest-asyncio",
33
33
  "websockets >=10.0",
34
- "pycrdt-websocket >=0.14.1,<0.15.0",
34
+ "pycrdt-websocket >=0.15.0,<0.16.0",
35
35
  ]
36
36
  docs = [
37
37
  "sphinx",
File without changes