Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-jupyter-ydoc for openSUSE:Factory checked in at 2024-11-08 11:59:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-jupyter-ydoc (Old) and /work/SRC/openSUSE:Factory/.python-jupyter-ydoc.new.2017 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-jupyter-ydoc" Fri Nov 8 11:59:51 2024 rev:10 rq:1222544 version:3.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-jupyter-ydoc/python-jupyter-ydoc.changes 2024-09-09 14:43:55.289407081 +0200 +++ /work/SRC/openSUSE:Factory/.python-jupyter-ydoc.new.2017/python-jupyter-ydoc.changes 2024-11-08 12:04:19.669848210 +0100 @@ -1,0 +2,51 @@ +Mon Nov 4 19:55:23 UTC 2024 - Ben Greiner <c...@bnavigator.de> + +- Update to 3.0.0 + ## Enhancements made + * Add the awareness in the shared document interface #282 + (@brichet) + * Doc awareness #277 (@brichet) + * Improve notebook output stream initialization #275 + (@davidbrochart) + * Add YDocument source getter/setter #273 (@davidbrochart) + * Allow empty notebook #266 (@davidbrochart) + * Add streamOutputChange attribute to cell change object #264 + (@davidbrochart) + * Add hash property with setter and getter #262 (@krassowski) + * Expose execution_state in the JS package #259 (@krassowski) + * Add undo_manager to Y documents #248 (@davidbrochart) + * Add optional origin to transaction, filter out 'modeldb' origin + #246 (@davidbrochart) + * Add appendStreamOutput and removeStreamOutput methods #241 + (@davidbrochart) + * Update python>=3.8, pycrdt>=0.8.11, pre-commit, README #217 + (@davidbrochart) + * Store YBlob as bytes, not base64-encoded string #209 + (@davidbrochart) + * Change notebook code cell stream output schema #201 + (@davidbrochart) + * Add cell execution_state #197 (@davidbrochart) + ## Bugs fixed + * Fix attachments change attribute assignment #260 (@krassowski) + * Fix createOutputs, rename 'modeldb' origin to 'silent-change' + #254 (@davidbrochart) + ## Maintenance and upkeep improvements + * Revert #266 #280 (@davidbrochart) + * Improve notebook output stream initialization #275 + (@davidbrochart) + * Fix dict type for python 3.8 #253 (@davidbrochart) + * Bump toshimaru/auto-author-assign from 2.1.0 to 2.1.1 #247 + (@dependabot) + * Revert publish 3.0.0a0 (9c87cfd) #245 (@davidbrochart) + * Update releaser workflows #244 (@jtpio) + * Bump notebook version 1.0.0 -> 2.0.0 #236 (@davidbrochart) + * Fix subscription type, update pycrdt>=0.8.16 #222 + (@davidbrochart) + * Update python>=3.8, pycrdt>=0.8.11, pre-commit, README #217 + (@davidbrochart) + * Bump pre-commit/action from 3.0.0 to 3.0.1 #215 (@dependabot) + * Remove mention to y_py in docs #214 (@martinRenou) + * Bump toshimaru/auto-author-assign from 2.0.1 to 2.1.0 #212 + (@dependabot) + +------------------------------------------------------------------- Old: ---- jupyter_ydoc-2.1.1-gh.tar.gz jupyter_ydoc-2.1.1.tar.gz New: ---- jupyter_ydoc-3.0.0-gh.tar.gz jupyter_ydoc-3.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-jupyter-ydoc.spec ++++++ --- /var/tmp/diff_new_pack.Jj3onx/_old 2024-11-08 12:04:20.225871495 +0100 +++ /var/tmp/diff_new_pack.Jj3onx/_new 2024-11-08 12:04:20.225871495 +0100 @@ -17,7 +17,7 @@ Name: python-jupyter-ydoc -Version: 2.1.1 +Version: 3.0.0 Release: 0 Summary: Document structures for collaborative editing using Ypy License: BSD-3-Clause @@ -29,20 +29,20 @@ Source2: node_modules.tar.xz # Execute this on every package update. See comments in the script. Source3: create_node_modules.sh -BuildRequires: %{python_module base >= 3.7} +BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module hatch_nodejs_version} BuildRequires: %{python_module hatchling >= 1.10} BuildRequires: %{python_module pip} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: (python-importlib-metadata >= 3.6 if python-base < 3.10) -Requires: (python-pycrdt >= 0.9 with python-pycrdt < 0.10) +Requires: (python-pycrdt >= 0.10.1 with python-pycrdt < 0.11) Provides: python-jupyter_ydoc = %{version}-%{release} BuildArch: noarch # SECTION test BuildRequires: %{python_module importlib-metadata >= 3.6 if %python-base < 3.10} -BuildRequires: %{python_module pycrdt >= 0.9 with %python-pycrdt < 0.10} -BuildRequires: %{python_module pycrdt-websocket >= 0.14.1 with %python-pycrdt-websocket < 0.15} +BuildRequires: %{python_module pycrdt >= 0.10.1 with %python-pycrdt < 0.11} +BuildRequires: %{python_module pycrdt-websocket >= 0.15.0 with %python-pycrdt-websocket < 0.16} BuildRequires: %{python_module pytest-asyncio} BuildRequires: %{python_module pytest} BuildRequires: %{python_module websockets >= 10.0} @@ -71,7 +71,7 @@ %check # https://github.com/jupyter-server/jupyter_ydoc/issues/168 -%pytest -v && pkill -f yjs_client_0.js -e +%pytest %files %{python_files} %{python_sitelib}/jupyter_ydoc ++++++ jupyter_ydoc-2.1.1-gh.tar.gz -> jupyter_ydoc-3.0.0-gh.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/.github/workflows/auto_author_assign.yml new/jupyter_ydoc-3.0.0/.github/workflows/auto_author_assign.yml --- old/jupyter_ydoc-2.1.1/.github/workflows/auto_author_assign.yml 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/.github/workflows/auto_author_assign.yml 2024-10-29 14:28:59.000000000 +0100 @@ -12,4 +12,4 @@ assign-author: runs-on: ubuntu-latest steps: - - uses: toshimaru/auto-author-assign@v2.0.1 + - uses: toshimaru/auto-author-assign@v2.1.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/.github/workflows/prep-release.yml new/jupyter_ydoc-3.0.0/.github/workflows/prep-release.yml --- old/jupyter_ydoc-2.1.1/.github/workflows/prep-release.yml 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/.github/workflows/prep-release.yml 2024-10-29 14:28:59.000000000 +0100 @@ -12,6 +12,10 @@ post_version_spec: description: "Post Version Specifier" required: false + silent: + description: "Set a placeholder in the changelog and don't publish the release." + required: false + type: boolean since: description: "Use PRs with activity since this date or git reference" required: false @@ -22,6 +26,8 @@ jobs: prep_release: runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 @@ -29,10 +35,10 @@ id: prep-release uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2 with: - token: ${{ secrets.ADMIN_GITHUB_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} version_spec: ${{ github.event.inputs.version_spec }} + silent: ${{ github.event.inputs.silent }} post_version_spec: ${{ github.event.inputs.post_version_spec }} - target: ${{ github.event.inputs.target }} branch: ${{ github.event.inputs.branch }} since: ${{ github.event.inputs.since }} since_last_stable: ${{ github.event.inputs.since_last_stable }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/.github/workflows/publish-release.yml new/jupyter_ydoc-3.0.0/.github/workflows/publish-release.yml --- old/jupyter_ydoc-2.1.1/.github/workflows/publish-release.yml 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/.github/workflows/publish-release.yml 2024-10-29 14:28:59.000000000 +0100 @@ -15,15 +15,23 @@ jobs: publish_release: runs-on: ubuntu-latest + environment: release + permissions: + id-token: write steps: - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + - name: Populate Release id: populate-release uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2 with: - token: ${{ secrets.ADMIN_GITHUB_TOKEN }} - target: ${{ github.event.inputs.target }} + token: ${{ steps.app-token.outputs.token }} branch: ${{ github.event.inputs.branch }} release_url: ${{ github.event.inputs.release_url }} steps_to_skip: ${{ github.event.inputs.steps_to_skip }} @@ -31,14 +39,10 @@ - name: Finalize Release id: finalize-release env: - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} - PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }} - TWINE_USERNAME: __token__ NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - uses: jupyter-server/jupyter-releaser/.github/actions/finalize-release@v2 + uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2 with: - token: ${{ secrets.ADMIN_GITHUB_TOKEN }} - target: ${{ github.event.inputs.target }} + token: ${{ steps.app-token.outputs.token }} release_url: ${{ steps.populate-release.outputs.release_url }} - name: "** Next Step **" @@ -46,6 +50,7 @@ run: | echo "Verify the final release" echo ${{ steps.finalize-release.outputs.release_url }} + - name: "** Failure Message **" if: ${{ failure() }} run: | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/.github/workflows/test.yml new/jupyter_ydoc-3.0.0/.github/workflows/test.yml --- old/jupyter_ydoc-2.1.1/.github/workflows/test.yml 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/.github/workflows/test.yml 2024-10-29 14:28:59.000000000 +0100 @@ -2,9 +2,9 @@ on: push: - branches: [2.x] + branches: [main] pull_request: - branches: [2.x] + branches: [main] jobs: pre-commit: @@ -13,7 +13,7 @@ steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 - - uses: pre-commit/action@v3.0.0 + - uses: pre-commit/action@v3.0.1 with: extra_args: --all-files --hook-stage=manual - name: Help message if pre-commit fail diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/.gitignore new/jupyter_ydoc-3.0.0/.gitignore --- old/jupyter_ydoc-2.1.1/.gitignore 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/.gitignore 2024-10-29 14:28:59.000000000 +0100 @@ -147,3 +147,5 @@ !.yarn/versions docs/source/api docs/source/changelog.md +# pixi environments +.pixi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/.pre-commit-config.yaml new/jupyter_ydoc-3.0.0/.pre-commit-config.yaml --- old/jupyter_ydoc-2.1.1/.pre-commit-config.yaml 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/.pre-commit-config.yaml 2024-10-29 14:28:59.000000000 +0100 @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v5.0.0 hooks: - id: end-of-file-fixer - id: check-case-conflict @@ -16,37 +16,9 @@ - id: trailing-whitespace exclude: ^\.yarn - - repo: https://github.com/psf/black - rev: 23.12.1 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.7.1 hooks: - - id: black - args: ["--line-length", "100"] - - - repo: https://github.com/PyCQA/isort - rev: 5.13.2 - hooks: - - id: isort - files: \.py$ - args: [--profile=black] - - - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 - hooks: - - id: pyupgrade - args: [--py37-plus] - - - repo: https://github.com/PyCQA/doc8 - rev: v1.1.1 - hooks: - - id: doc8 - args: [--max-line-length=200] - exclude: docs/source/other/full-config.rst - stages: [manual] - - - repo: https://github.com/pycqa/flake8 - rev: 6.1.0 - hooks: - - id: flake8 - additional_dependencies: - ["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0", "flake8-pyproject"] - stages: [manual] + - id: ruff + args: [--fix, --show-fixes] + - id: ruff-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/CHANGELOG.md new/jupyter_ydoc-3.0.0/CHANGELOG.md --- old/jupyter_ydoc-2.1.1/CHANGELOG.md 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/CHANGELOG.md 2024-10-29 14:28:59.000000000 +0100 @@ -2,35 +2,275 @@ <!-- <START NEW CHANGELOG ENTRY> --> -## 2.1.1 +## 3.0.0 -([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@2.1.0...9c7a436bf9cd3ab36c8ec285a7a2225fc2d195e0)) +([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@2.0.1...8cf3b0f53bf763edf254e91fed65aaa7062e3250)) + +### Enhancements made + +- Add the awareness in the shared document interface [#282](https://github.com/jupyter-server/jupyter_ydoc/pull/282) ([@brichet](https://github.com/brichet)) +- Doc awareness [#277](https://github.com/jupyter-server/jupyter_ydoc/pull/277) ([@brichet](https://github.com/brichet)) +- Improve notebook output stream initialization [#275](https://github.com/jupyter-server/jupyter_ydoc/pull/275) ([@davidbrochart](https://github.com/davidbrochart)) +- Add YDocument source getter/setter [#273](https://github.com/jupyter-server/jupyter_ydoc/pull/273) ([@davidbrochart](https://github.com/davidbrochart)) +- Allow empty notebook [#266](https://github.com/jupyter-server/jupyter_ydoc/pull/266) ([@davidbrochart](https://github.com/davidbrochart)) +- Add `streamOutputChange` attribute to cell change object [#264](https://github.com/jupyter-server/jupyter_ydoc/pull/264) ([@davidbrochart](https://github.com/davidbrochart)) +- Add `hash` property with setter and getter [#262](https://github.com/jupyter-server/jupyter_ydoc/pull/262) ([@krassowski](https://github.com/krassowski)) +- Expose `execution_state` in the JS package [#259](https://github.com/jupyter-server/jupyter_ydoc/pull/259) ([@krassowski](https://github.com/krassowski)) +- Add undo_manager to Y documents [#248](https://github.com/jupyter-server/jupyter_ydoc/pull/248) ([@davidbrochart](https://github.com/davidbrochart)) +- Add optional origin to transaction, filter out 'modeldb' origin [#246](https://github.com/jupyter-server/jupyter_ydoc/pull/246) ([@davidbrochart](https://github.com/davidbrochart)) +- Add appendStreamOutput and removeStreamOutput methods [#241](https://github.com/jupyter-server/jupyter_ydoc/pull/241) ([@davidbrochart](https://github.com/davidbrochart)) +- Update python>=3.8, pycrdt>=0.8.11, pre-commit, README [#217](https://github.com/jupyter-server/jupyter_ydoc/pull/217) ([@davidbrochart](https://github.com/davidbrochart)) +- Store YBlob as bytes, not base64-encoded string [#209](https://github.com/jupyter-server/jupyter_ydoc/pull/209) ([@davidbrochart](https://github.com/davidbrochart)) +- Change notebook code cell stream output schema [#201](https://github.com/jupyter-server/jupyter_ydoc/pull/201) ([@davidbrochart](https://github.com/davidbrochart)) +- Add cell execution_state [#197](https://github.com/jupyter-server/jupyter_ydoc/pull/197) ([@davidbrochart](https://github.com/davidbrochart)) + +### Bugs fixed + +- Fix attachments change attribute assignment [#260](https://github.com/jupyter-server/jupyter_ydoc/pull/260) ([@krassowski](https://github.com/krassowski)) +- Fix createOutputs, rename 'modeldb' origin to 'silent-change' [#254](https://github.com/jupyter-server/jupyter_ydoc/pull/254) ([@davidbrochart](https://github.com/davidbrochart)) ### Maintenance and upkeep improvements -- Fix dict type for python 3.8 [#252](https://github.com/jupyter-server/jupyter_ydoc/pull/252) ([@davidbrochart](https://github.com/davidbrochart)) +- Revert #266 [#280](https://github.com/jupyter-server/jupyter_ydoc/pull/280) ([@davidbrochart](https://github.com/davidbrochart)) +- Improve notebook output stream initialization [#275](https://github.com/jupyter-server/jupyter_ydoc/pull/275) ([@davidbrochart](https://github.com/davidbrochart)) +- Fix dict type for python 3.8 [#253](https://github.com/jupyter-server/jupyter_ydoc/pull/253) ([@davidbrochart](https://github.com/davidbrochart)) +- Bump toshimaru/auto-author-assign from 2.1.0 to 2.1.1 [#247](https://github.com/jupyter-server/jupyter_ydoc/pull/247) ([@dependabot](https://github.com/dependabot)) +- Revert publish 3.0.0a0 (9c87cfd7c7e967a1fbef8ce96899d426862e84fb) [#245](https://github.com/jupyter-server/jupyter_ydoc/pull/245) ([@davidbrochart](https://github.com/davidbrochart)) +- Update releaser workflows [#244](https://github.com/jupyter-server/jupyter_ydoc/pull/244) ([@jtpio](https://github.com/jtpio)) +- Bump notebook version 1.0.0 -> 2.0.0 [#236](https://github.com/jupyter-server/jupyter_ydoc/pull/236) ([@davidbrochart](https://github.com/davidbrochart)) +- Fix subscription type, update pycrdt>=0.8.16 [#222](https://github.com/jupyter-server/jupyter_ydoc/pull/222) ([@davidbrochart](https://github.com/davidbrochart)) +- Update python>=3.8, pycrdt>=0.8.11, pre-commit, README [#217](https://github.com/jupyter-server/jupyter_ydoc/pull/217) ([@davidbrochart](https://github.com/davidbrochart)) +- Bump pre-commit/action from 3.0.0 to 3.0.1 [#215](https://github.com/jupyter-server/jupyter_ydoc/pull/215) ([@dependabot](https://github.com/dependabot)) +- Remove mention to y_py in docs [#214](https://github.com/jupyter-server/jupyter_ydoc/pull/214) ([@martinRenou](https://github.com/martinRenou)) +- Bump toshimaru/auto-author-assign from 2.0.1 to 2.1.0 [#212](https://github.com/jupyter-server/jupyter_ydoc/pull/212) ([@dependabot](https://github.com/dependabot)) + +### Documentation improvements + +- Remove mention to y_py in docs [#214](https://github.com/jupyter-server/jupyter_ydoc/pull/214) ([@martinRenou](https://github.com/martinRenou)) ### Contributors to this release -([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2024-07-10&to=2024-07-10&type=c)) +([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2023-12-26&to=2024-10-29&type=c)) -[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2024-07-10..2024-07-10&type=Issues) +[@brichet](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Abrichet+updated%3A2023-12-26..2024-10-29&type=Issues) | [@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2023-12-26..2024-10-29&type=Issues) | [@dependabot](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adependabot+updated%3A2023-12-26..2024-10-29&type=Issues) | [@jtpio](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Ajtpio+updated%3A2023-12-26..2024-10-29&type=Issues) | [@krassowski](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Akrassowski+updated%3A2023-12-26..2024-10-29&type=Issues) | [@lumberbot-app](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Alumberbot-app+updated%3A2023-12-26..2024-10-29&type=Issues) | [@martinRenou](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3AmartinRenou+upda ted%3A2023-12-26..2024-10-29&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Apre-commit-ci+updated%3A2023-12-26..2024-10-29&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Awelcome+updated%3A2023-12-26..2024-10-29&type=Issues) | [@Zsailer](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3AZsailer+updated%3A2023-12-26..2024-10-29&type=Issues) <!-- <END NEW CHANGELOG ENTRY> --> -## 2.1.0 +## 3.0.0b0 + +([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@3.0.0-a10...5a205d912bb399684a2886d4d323b77669f63eb8)) + +### Enhancements made + +- Add the awareness in the shared document interface [#282](https://github.com/jupyter-server/jupyter_ydoc/pull/282) ([@brichet](https://github.com/brichet)) + +### Contributors to this release + +([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2024-10-17&to=2024-10-18&type=c)) + +[@brichet](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Abrichet+updated%3A2024-10-17..2024-10-18&type=Issues) + +## 3.0.0a10 + +([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@3.0.0-a9...dc71f641f72826232772509a8c9cea474d7ccc9f)) + +### Maintenance and upkeep improvements + +- Revert #266 [#280](https://github.com/jupyter-server/jupyter_ydoc/pull/280) ([@davidbrochart](https://github.com/davidbrochart)) + +### Contributors to this release + +([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)) + +[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2024-10-10..2024-10-17&type=Issues) + +## 3.0.0a9 + +([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@3.0.0-a8...877e5b9bb449b6f4e2472337e41f27c3bf24ead1)) + +### Enhancements made + +- Doc awareness [#277](https://github.com/jupyter-server/jupyter_ydoc/pull/277) ([@brichet](https://github.com/brichet)) + +### Maintenance and upkeep improvements + +### Contributors to this release + +([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)) + +[@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) + +## 3.0.0a8 + +([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@3.0.0-a7...b20878676d4564641ac142804eaf27331ddb342c)) + +### Enhancements made + +- Improve notebook output stream initialization [#275](https://github.com/jupyter-server/jupyter_ydoc/pull/275) ([@davidbrochart](https://github.com/davidbrochart)) + +### Maintenance and upkeep improvements + +- Improve notebook output stream initialization [#275](https://github.com/jupyter-server/jupyter_ydoc/pull/275) ([@davidbrochart](https://github.com/davidbrochart)) + +### Contributors to this release + +([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2024-09-18&to=2024-09-26&type=c)) + +[@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) + +## 3.0.0a7 + +([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@3.0.0-a6...3f323117ba2e8cf36f0e06c0ec9b9fa2c192278b)) + +### Enhancements made + +- Add YDocument source getter/setter [#273](https://github.com/jupyter-server/jupyter_ydoc/pull/273) ([@davidbrochart](https://github.com/davidbrochart)) + +### Maintenance and upkeep improvements + +### Contributors to this release + +([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2024-08-30&to=2024-09-18&type=c)) + +[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2024-08-30..2024-09-18&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Apre-commit-ci+updated%3A2024-08-30..2024-09-18&type=Issues) + +## 3.0.0a6 + +([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@3.0.0-a5...00ca649ec94ec5a00dad9656f7a122a7f9248590)) + +### Enhancements made + +- Allow empty notebook [#266](https://github.com/jupyter-server/jupyter_ydoc/pull/266) ([@davidbrochart](https://github.com/davidbrochart)) + +### Maintenance and upkeep improvements + +### Contributors to this release + +([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2024-08-23&to=2024-08-30&type=c)) + +[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2024-08-23..2024-08-30&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Apre-commit-ci+updated%3A2024-08-23..2024-08-30&type=Issues) + +## 3.0.0a5 + +([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@3.0.0-a4...e97181c93ce91fdb56968b9e4ed8fc6006049cd5)) -([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@2.0.1...78231c1ef972aa59b5cf10aaa188bd01e34a315f)) +### Enhancements made + +- Add `streamOutputChange` attribute to cell change object [#264](https://github.com/jupyter-server/jupyter_ydoc/pull/264) ([@davidbrochart](https://github.com/davidbrochart)) ### Maintenance and upkeep improvements -- Add undo_manager to Y documents (#248) [#251](https://github.com/jupyter-server/jupyter_ydoc/pull/251) ([@davidbrochart](https://github.com/davidbrochart)) +### Contributors to this release + +([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2024-08-19&to=2024-08-23&type=c)) + +[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2024-08-19..2024-08-23&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Apre-commit-ci+updated%3A2024-08-19..2024-08-23&type=Issues) + +## 3.0.0a4 + +([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@3.0.0-a3...14a8573f296086865849673d68ad4b1aaab2eb82)) + +### Enhancements made + +- Add `hash` property with setter and getter [#262](https://github.com/jupyter-server/jupyter_ydoc/pull/262) ([@krassowski](https://github.com/krassowski)) + +### Bugs fixed + +- Fix attachments change attribute assignment [#260](https://github.com/jupyter-server/jupyter_ydoc/pull/260) ([@krassowski](https://github.com/krassowski)) + +### Maintenance and upkeep improvements + +### Contributors to this release + +([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2024-08-07&to=2024-08-19&type=c)) + +[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2024-08-07..2024-08-19&type=Issues) | [@krassowski](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Akrassowski+updated%3A2024-08-07..2024-08-19&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Apre-commit-ci+updated%3A2024-08-07..2024-08-19&type=Issues) + +## 3.0.0a3 + +([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@3.0.0-a2...8fbbd6985f686e7876b301ad5637052001caa128)) + +### Enhancements made + +- Expose `execution_state` in the JS package [#259](https://github.com/jupyter-server/jupyter_ydoc/pull/259) ([@krassowski](https://github.com/krassowski)) +- Add cell execution_state [#197](https://github.com/jupyter-server/jupyter_ydoc/pull/197) ([@davidbrochart](https://github.com/davidbrochart)) + +### Maintenance and upkeep improvements + +### Contributors to this release + +([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2024-07-12&to=2024-08-07&type=c)) + +[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2024-07-12..2024-08-07&type=Issues) | [@krassowski](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Akrassowski+updated%3A2024-07-12..2024-08-07&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Apre-commit-ci+updated%3A2024-07-12..2024-08-07&type=Issues) + +## 3.0.0a2 + +([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@3.0.0-a1...db935c175e8b3d37ec32284b5171c26458817528)) + +### Bugs fixed + +- Fix createOutputs, rename 'modeldb' origin to 'silent-change' [#254](https://github.com/jupyter-server/jupyter_ydoc/pull/254) ([@davidbrochart](https://github.com/davidbrochart)) + +### Maintenance and upkeep improvements + +- Fix dict type for python 3.8 [#253](https://github.com/jupyter-server/jupyter_ydoc/pull/253) ([@davidbrochart](https://github.com/davidbrochart)) + +### Contributors to this release + +([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2024-07-05&to=2024-07-12&type=c)) + +[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2024-07-05..2024-07-12&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Apre-commit-ci+updated%3A2024-07-05..2024-07-12&type=Issues) + +## 3.0.0a1 + +([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@3.0.0-a0...8e3f25bdcfb8ed36cd740dd958d5d04580cd54ef)) + +### Enhancements made + +- Add undo_manager to Y documents [#248](https://github.com/jupyter-server/jupyter_ydoc/pull/248) ([@davidbrochart](https://github.com/davidbrochart)) +- Add optional origin to transaction, filter out 'modeldb' origin [#246](https://github.com/jupyter-server/jupyter_ydoc/pull/246) ([@davidbrochart](https://github.com/davidbrochart)) + +### Maintenance and upkeep improvements + +- Bump toshimaru/auto-author-assign from 2.1.0 to 2.1.1 [#247](https://github.com/jupyter-server/jupyter_ydoc/pull/247) ([@dependabot](https://github.com/dependabot)) + +### Contributors to this release + +([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2024-06-26&to=2024-07-05&type=c)) + +[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2024-06-26..2024-07-05&type=Issues) | [@dependabot](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adependabot+updated%3A2024-06-26..2024-07-05&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Apre-commit-ci+updated%3A2024-06-26..2024-07-05&type=Issues) + +## 3.0.0a0 + +([Full Changelog](https://github.com/jupyter-server/jupyter_ydoc/compare/@jupyter/ydoc@2.0.1...cc9a21d918ca5cd4336b65783586ca74ca98a889)) + +### Enhancements made + +- Add appendStreamOutput and removeStreamOutput methods [#241](https://github.com/jupyter-server/jupyter_ydoc/pull/241) ([@davidbrochart](https://github.com/davidbrochart)) +- Update python>=3.8, pycrdt>=0.8.11, pre-commit, README [#217](https://github.com/jupyter-server/jupyter_ydoc/pull/217) ([@davidbrochart](https://github.com/davidbrochart)) +- Store YBlob as bytes, not base64-encoded string [#209](https://github.com/jupyter-server/jupyter_ydoc/pull/209) ([@davidbrochart](https://github.com/davidbrochart)) +- Change notebook code cell stream output schema [#201](https://github.com/jupyter-server/jupyter_ydoc/pull/201) ([@davidbrochart](https://github.com/davidbrochart)) + +### Maintenance and upkeep improvements + +- Revert publish 3.0.0a0 (9c87cfd7c7e967a1fbef8ce96899d426862e84fb) [#245](https://github.com/jupyter-server/jupyter_ydoc/pull/245) ([@davidbrochart](https://github.com/davidbrochart)) +- Update releaser workflows [#244](https://github.com/jupyter-server/jupyter_ydoc/pull/244) ([@jtpio](https://github.com/jtpio)) +- Bump notebook version 1.0.0 -> 2.0.0 [#236](https://github.com/jupyter-server/jupyter_ydoc/pull/236) ([@davidbrochart](https://github.com/davidbrochart)) +- Fix subscription type, update pycrdt>=0.8.16 [#222](https://github.com/jupyter-server/jupyter_ydoc/pull/222) ([@davidbrochart](https://github.com/davidbrochart)) +- Update python>=3.8, pycrdt>=0.8.11, pre-commit, README [#217](https://github.com/jupyter-server/jupyter_ydoc/pull/217) ([@davidbrochart](https://github.com/davidbrochart)) +- Bump pre-commit/action from 3.0.0 to 3.0.1 [#215](https://github.com/jupyter-server/jupyter_ydoc/pull/215) ([@dependabot](https://github.com/dependabot)) +- Remove mention to y_py in docs [#214](https://github.com/jupyter-server/jupyter_ydoc/pull/214) ([@martinRenou](https://github.com/martinRenou)) +- Bump toshimaru/auto-author-assign from 2.0.1 to 2.1.0 [#212](https://github.com/jupyter-server/jupyter_ydoc/pull/212) ([@dependabot](https://github.com/dependabot)) + +### Documentation improvements + +- Remove mention to y_py in docs [#214](https://github.com/jupyter-server/jupyter_ydoc/pull/214) ([@martinRenou](https://github.com/martinRenou)) ### Contributors to this release -([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2023-12-26&to=2024-07-10&type=c)) +([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_ydoc/graphs/contributors?from=2023-12-26&to=2024-06-26&type=c)) -[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2023-12-26..2024-07-10&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Awelcome+updated%3A2023-12-26..2024-07-10&type=Issues) | [@Zsailer](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3AZsailer+updated%3A2023-12-26..2024-07-10&type=Issues) +[@davidbrochart](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adavidbrochart+updated%3A2023-12-26..2024-06-26&type=Issues) | [@dependabot](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Adependabot+updated%3A2023-12-26..2024-06-26&type=Issues) | [@jtpio](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Ajtpio+updated%3A2023-12-26..2024-06-26&type=Issues) | [@martinRenou](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3AmartinRenou+updated%3A2023-12-26..2024-06-26&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Apre-commit-ci+updated%3A2023-12-26..2024-06-26&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3Awelcome+updated%3A2023-12-26..2024-06-26&type=Issues) | [@Zsailer](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_ydoc+involves%3AZsailer+updated%3A 2023-12-26..2024-06-26&type=Issues) ## 2.0.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/README.md new/jupyter_ydoc-3.0.0/README.md --- old/jupyter_ydoc-2.1.1/README.md 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/README.md 2024-10-29 14:28:59.000000000 +0100 @@ -5,7 +5,7 @@ # jupyter_ydoc -`jupyter_ydoc` provides [Ypy](https://github.com/y-crdt/ypy)-based data structures for various +`jupyter_ydoc` provides [pycrdt](https://github.com/jupyter-server/pycrdt)-based data structures for various documents used in the Jupyter ecosystem. Built-in documents include: - `YBlob`: a generic immutable binary document. - `YUnicode`: a generic UTF8-encoded text document (`YFile` is an alias to `YUnicode`). @@ -29,9 +29,11 @@ Which is just a shortcut to: ```py -import pkg_resources +from importlib.metadata import entry_points +# for Python < 3.10, install importlib_metadata and do: +# from importlib_metadata import entry_points -ydocs = {ep.name: ep.load() for ep in pkg_resources.iter_entry_points(group="jupyter_ydoc")} +ydocs = {ep.name: ep.load() for ep in entry_points(group="jupyter_ydoc")} ``` Or directly import them: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/docs/source/overview.md new/jupyter_ydoc-3.0.0/docs/source/overview.md --- old/jupyter_ydoc-2.1.1/docs/source/overview.md 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/docs/source/overview.md 2024-10-29 14:28:59.000000000 +0100 @@ -1,6 +1,6 @@ # Overview -The `jupyter_ydoc` repository includes various models that JupyterLab uses for collaborative editing. These models use a specific implementation of a CRDT, the Y-CRDTs. To be more precise, the JavaScript package uses [yjs](https://github.com/yjs/yjs), while the Python package uses [y_py](https://github.com/y-crdt/ypy). +The `jupyter_ydoc` repository includes various models that JupyterLab uses for collaborative editing. These models use a specific implementation of a CRDT, the Y-CRDTs. To be more precise, the JavaScript package uses [yjs](https://github.com/yjs/yjs), while the Python package uses [pycrdt](https://github.com/jupyter-server/pycrdt). Jupyter YDoc was designed to centralize the data structures used for composing a document in a single class, hide the complicated edge cases of CRDTs, and prevent users from inserting invalid data or adding new attributes to the document that are not part of the schema. @@ -19,7 +19,7 @@ ## `jupyter-ydoc` -Built on top of [y_py](https://github.com/y-crdt/ypy), `jupyter-ydoc` is a Python package that includes the models used in the JupyterLab back-end for representing collaborative documents. +Built on top of [pycrdt](https://github.com/jupyter-server/pycrdt), `jupyter-ydoc` is a Python package that includes the models used in the JupyterLab back-end for representing collaborative documents. **Source Code:** [GitHub](https://github.com/jupyter-server/jupyter_ydoc/tree/main/jupyter_ydoc) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/javascript/package.json new/jupyter_ydoc-3.0.0/javascript/package.json --- old/jupyter_ydoc-2.1.1/javascript/package.json 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/javascript/package.json 2024-10-29 14:28:59.000000000 +0100 @@ -1,6 +1,6 @@ { "name": "@jupyter/ydoc", - "version": "2.1.1", + "version": "3.0.0", "type": "module", "description": "Jupyter document structures for collaborative editing using YJS", "homepage": "https://github.com/jupyter-server/jupyter_ydoc", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/javascript/src/api.ts new/jupyter_ydoc-3.0.0/javascript/src/api.ts --- old/jupyter_ydoc-2.1.1/javascript/src/api.ts 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/javascript/src/api.ts 2024-10-29 14:28:59.000000000 +0100 @@ -22,6 +22,8 @@ } from '@lumino/coreutils'; import type { IObservableDisposable } from '@lumino/disposable'; import type { ISignal } from '@lumino/signaling'; +import * as Y from 'yjs'; +import { IAwareness } from './awareness.js'; /** * Changes on Sequence-like data are expressed as Quill-inspired deltas. @@ -77,14 +79,14 @@ * @param f Transaction to execute * @param undoable Whether to track the change in the action history or not (default `true`) */ - transact(f: () => void, undoable?: boolean): void; + transact(f: () => void, undoable?: boolean, origin?: any): void; } /** * Implement an API for Context information on the shared information. * This is used by, for example, docregistry to share the file-path of the edited content. */ -export interface ISharedDocument extends ISharedBase { +interface ISharedDocumentNoSource extends ISharedBase { /** * Document version */ @@ -96,6 +98,11 @@ readonly state: JSONObject; /** + * Document awareness + */ + readonly awareness: IAwareness; + + /** * Get the value for a state attribute * * @param key Key to get @@ -117,6 +124,26 @@ } /** + * Implement an API for Context information on the shared information. + * This is used by, for example, docregistry to share the file-path of the edited content. + */ +export interface ISharedDocument extends ISharedDocumentNoSource { + /** + * Get the document source. + * + * @returns Source. + */ + getSource(): string | JSONValue; + + /** + * Set the document source. + * + * @param value New source. + */ + setSource(value: string | JSONValue): void; +} + +/** * The ISharedText interface defines models that can be bound to a text editor like CodeMirror. */ export interface ISharedText extends ISharedBase { @@ -157,7 +184,7 @@ /** * Text/Markdown/Code files are represented as ISharedFile */ -export interface ISharedFile extends ISharedDocument, ISharedText { +export interface ISharedFile extends ISharedDocumentNoSource, ISharedText { /** * The changed signal. */ @@ -493,6 +520,8 @@ toJSON(): nbformat.IBaseCell; } +export type IExecutionState = 'running' | 'idle'; + /** * Implements an API for nbformat.ICodeCell. */ @@ -509,6 +538,11 @@ execution_count: nbformat.ExecutionCount; /** + * The code cell's execution state. + */ + executionState: IExecutionState; + + /** * Cell outputs */ outputs: Array<nbformat.IOutput>; @@ -737,7 +771,11 @@ /** * Cell output changes */ - outputsChange?: Delta<nbformat.IOutput[]>; + outputsChange?: Delta<Y.Map<any>>; + /** + * Cell stream output text changes + */ + streamOutputChange?: Delta<Y.Text>; /** * Cell execution count change */ @@ -746,6 +784,13 @@ newValue?: number; }; /** + * Cell execution state change + */ + executionStateChange?: { + oldValue?: IExecutionState; + newValue?: IExecutionState; + }; + /** * Cell metadata change */ metadataChange?: MapChanges; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/javascript/src/ycell.ts new/jupyter_ydoc-3.0.0/javascript/src/ycell.ts --- old/jupyter_ydoc-2.1.1/javascript/src/ycell.ts 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/javascript/src/ycell.ts 2024-10-29 14:28:59.000000000 +0100 @@ -10,6 +10,7 @@ import * as Y from 'yjs'; import type { CellChange, + IExecutionState, IMapChange, ISharedAttachmentsCell, ISharedBaseCell, @@ -564,11 +565,11 @@ * @param f Transaction to execute * @param undoable Whether to track the change in the action history or not (default `true`) */ - transact(f: () => void, undoable = true): void { + transact(f: () => void, undoable = true, origin: any = null): void { !this.notebook || this.notebook.disableDocumentWideUndoRedo ? this.ymodel.doc == null ? f() - : this.ymodel.doc.transact(f, undoable ? this : null) + : this.ymodel.doc.transact(f, undoable ? this : origin) : this.notebook.transact(f, undoable); } @@ -656,8 +657,13 @@ /** * Handle a change to the ymodel. */ - private _modelObserver = (events: Y.YEvent<any>[]) => { - this._changed.emit(this.getChanges(events)); + private _modelObserver = ( + events: Y.YEvent<any>[], + transaction: Y.Transaction + ) => { + if (transaction.origin !== 'silent-change') { + this._changed.emit(this.getChanges(events)); + } }; protected _metadataChanged = new Signal<this, IMapChange>(this); @@ -745,6 +751,20 @@ } /** + * The code cell's execution state. + */ + get executionState(): IExecutionState { + return this.ymodel.get('execution_state') ?? 'idle'; + } + set executionState(state: IExecutionState) { + if (this.ymodel.get('execution_state') !== state) { + this.transact(() => { + this.ymodel.set('execution_state', state); + }, false); + } + } + + /** * Cell outputs. */ get outputs(): Array<nbformat.IOutput> { @@ -753,12 +773,40 @@ set outputs(v: Array<nbformat.IOutput>) { this.setOutputs(v); } + get youtputs(): Y.Array<any> { + return this._youtputs; + } /** * Execution, display, or stream outputs. */ getOutputs(): Array<nbformat.IOutput> { - return JSONExt.deepCopy(this._youtputs.toArray()); + return JSONExt.deepCopy(this._youtputs.toJSON()); + } + + createOutputs(outputs: Array<nbformat.IOutput>): Array<Y.Map<any>> { + const newOutputs: Array<Y.Map<any>> = []; + for (const output of JSONExt.deepCopy(outputs)) { + let _newOutput1: { [id: string]: any }; + if (output.output_type === 'stream') { + // Set the text field as a Y.Text + const { text, ...outputWithoutText } = output; + _newOutput1 = outputWithoutText; + const newText = new Y.Text(); + let _text = text instanceof Array ? text.join() : (text as string); + newText.insert(0, _text); + _newOutput1['text'] = newText; + } else { + _newOutput1 = output; + } + const _newOutput2: [string, any][] = []; + for (const [key, value] of Object.entries(_newOutput1)) { + _newOutput2.push([key, value]); + } + const newOutput = new Y.Map(_newOutput2); + newOutputs.push(newOutput); + } + return newOutputs; } /** @@ -767,11 +815,43 @@ setOutputs(outputs: Array<nbformat.IOutput>): void { this.transact(() => { this._youtputs.delete(0, this._youtputs.length); - this._youtputs.insert(0, outputs); + const newOutputs = this.createOutputs(outputs); + this._youtputs.insert(0, newOutputs); }, false); } /** + * Remove text from a stream output. + */ + removeStreamOutput(index: number, start: number, origin: any = null): void { + this.transact( + () => { + const output = this._youtputs.get(index); + const prevText = output.get('text') as Y.Text; + const length = prevText.length - start; + prevText.delete(start, length); + }, + false, + origin + ); + } + + /** + * Append text to a stream output. + */ + appendStreamOutput(index: number, text: string, origin: any = null): void { + this.transact( + () => { + const output = this._youtputs.get(index); + const prevText = output.get('text') as Y.Text; + prevText.insert(prevText.length, text); + }, + false, + origin + ); + } + + /** * Replace content from `start' to `end` with `outputs`. * * @param start: The start index of the range to replace (inclusive). @@ -783,14 +863,20 @@ updateOutputs( start: number, end: number, - outputs: Array<nbformat.IOutput> = [] + outputs: Array<nbformat.IOutput> = [], + origin: any = null ): void { const fin = end < this._youtputs.length ? end - start : this._youtputs.length - start; - this.transact(() => { - this._youtputs.delete(start, fin); - this._youtputs.insert(start, outputs); - }, false); + this.transact( + () => { + this._youtputs.delete(start, fin); + const newOutputs = this.createOutputs(outputs); + this._youtputs.insert(start, newOutputs); + }, + false, + origin + ); } /** @@ -813,6 +899,19 @@ protected getChanges(events: Y.YEvent<any>[]): Partial<CellChange> { const changes = super.getChanges(events); + const streamOutputEvent = events.find( + // Changes to the 'text' of a cell's stream output can be accessed like so: + // ycell['outputs'][output_idx]['text'] + // This translates to an event path of: ['outputs', output_idx, 'text] + event => + event.path.length === 3 && + event.path[0] === 'outputs' && + event.path[2] === 'text' + ); + if (streamOutputEvent) { + changes.streamOutputChange = streamOutputEvent.changes.delta as any; + } + const outputEvent = events.find( event => event.target === this.ymodel.get('outputs') ); @@ -832,10 +931,18 @@ }; } + if (modelEvent && modelEvent.keysChanged.has('execution_state')) { + const change = modelEvent.changes.keys.get('execution_state'); + changes.executionStateChange = { + oldValue: change!.oldValue, + newValue: this.ymodel.get('execution_state') + }; + } + return changes; } - private _youtputs: Y.Array<nbformat.IOutput>; + private _youtputs: Y.Array<Y.Map<any>>; } class YAttachmentCell @@ -891,7 +998,7 @@ if (modelEvent && modelEvent.keysChanged.has('attachments')) { const change = modelEvent.changes.keys.get('attachments'); - changes.executionCountChange = { + changes.attachmentsChange = { oldValue: change!.oldValue, newValue: this.ymodel.get('attachments') }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/javascript/src/ydocument.ts new/jupyter_ydoc-3.0.0/javascript/src/ydocument.ts --- old/jupyter_ydoc-2.1.1/javascript/src/ydocument.ts 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/javascript/src/ydocument.ts 2024-10-29 14:28:59.000000000 +0100 @@ -146,6 +146,38 @@ } /** + * Get the document source + * + * @returns The source + */ + get source(): JSONValue | string { + return this.getSource(); + } + + /** + * Set the document source + * + * @param value The source to set + */ + set source(value: JSONValue | string) { + this.setSource(value); + } + + /** + * Get the document source + * + * @returns The source + */ + abstract getSource(): JSONValue | string; + + /** + * Set the document source + * + * @param value The source to set + */ + abstract setSource(value: JSONValue | string): void; + + /** * Undo an operation. */ undo(): void { @@ -170,8 +202,8 @@ * Perform a transaction. While the function f is called, all changes to the shared * document are bundled into a single event. */ - transact(f: () => void, undoable = true): void { - this.ydoc.transact(f, undoable ? this : null); + transact(f: () => void, undoable = true, origin: any = null): void { + this.ydoc.transact(f, undoable ? this : origin); } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/javascript/src/ynotebook.ts new/jupyter_ydoc-3.0.0/javascript/src/ynotebook.ts --- old/jupyter_ydoc-2.1.1/javascript/src/ynotebook.ts 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/javascript/src/ynotebook.ts 2024-10-29 14:28:59.000000000 +0100 @@ -4,7 +4,7 @@ |----------------------------------------------------------------------------*/ import type * as nbformat from '@jupyterlab/nbformat'; -import { JSONExt, PartialJSONValue } from '@lumino/coreutils'; +import { JSONExt, JSONValue, PartialJSONValue } from '@lumino/coreutils'; import { ISignal, Signal } from '@lumino/signaling'; import * as Y from 'yjs'; import type { @@ -69,7 +69,7 @@ /** * Document version */ - readonly version: string = '1.0.0'; + readonly version: string = '2.0.0'; /** * Creates a standalone YNotebook @@ -405,6 +405,24 @@ } /** + * Get the notebook source + * + * @returns The notebook + */ + getSource(): JSONValue { + return this.toJSON() as JSONValue; + } + + /** + * Set the notebook source + * + * @param value The notebook + */ + setSource(value: JSONValue): void { + this.fromJSON(value as nbformat.INotebookContent); + } + + /** * Override the notebook with a JSON-serialized document. * * @param value The notebook diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/jupyter_ydoc/__init__.py new/jupyter_ydoc-3.0.0/jupyter_ydoc/__init__.py --- old/jupyter_ydoc-2.1.1/jupyter_ydoc/__init__.py 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/jupyter_ydoc/__init__.py 2024-10-29 14:28:59.000000000 +0100 @@ -3,11 +3,11 @@ import sys -from ._version import __version__ # noqa -from .yblob import YBlob # noqa -from .yfile import YFile # noqa -from .ynotebook import YNotebook # noqa -from .yunicode import YUnicode # noqa +from ._version import __version__ as __version__ +from .yblob import YBlob as YBlob +from .yfile import YFile as YFile +from .ynotebook import YNotebook as YNotebook +from .yunicode import YUnicode as YUnicode # See compatibility note on `group` keyword in # https://docs.python.org/3/library/importlib.metadata.html#entry-points diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/jupyter_ydoc/ybasedoc.py new/jupyter_ydoc-3.0.0/jupyter_ydoc/ybasedoc.py --- old/jupyter_ydoc-2.1.1/jupyter_ydoc/ybasedoc.py 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/jupyter_ydoc/ybasedoc.py 2024-10-29 14:28:59.000000000 +0100 @@ -4,7 +4,7 @@ from abc import ABC, abstractmethod from typing import Any, Callable, Dict, Optional -from pycrdt import Doc, Map, Subscription, UndoManager +from pycrdt import Awareness, Doc, Map, Subscription, UndoManager class YBaseDoc(ABC): @@ -20,17 +20,22 @@ _subscriptions: Dict[Any, Subscription] _undo_manager: UndoManager - def __init__(self, ydoc: Optional[Doc] = None): + def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] = None): """ Constructs a YBaseDoc. :param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided. :type ydoc: :class:`pycrdt.Doc`, optional. + :param awareness: The :class:`pycrdt.Awareness` that shares non persistent data + between clients. + :type awareness: :class:`pycrdt.Awareness`, optional. """ if ydoc is None: self._ydoc = Doc() else: self._ydoc = ydoc + self.awareness = awareness + self._ystate = self._ydoc.get("state", type=Map) self._subscriptions = {} self._undo_manager = UndoManager(doc=self._ydoc, capture_timeout_millis=0) @@ -115,6 +120,26 @@ self._ystate["dirty"] = value @property + def hash(self) -> Optional[str]: + """ + Returns the document hash as computed by contents manager. + + :return: The document hash. + :rtype: Optional[str] + """ + return self._ystate.get("hash") + + @hash.setter + def hash(self, value: str) -> None: + """ + Sets the document hash. + + :param value: The document hash. + :type value: str + """ + self._ystate["hash"] = value + + @property def path(self) -> Optional[str]: """ Returns document's path. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/jupyter_ydoc/yblob.py new/jupyter_ydoc-3.0.0/jupyter_ydoc/yblob.py --- old/jupyter_ydoc-2.1.1/jupyter_ydoc/yblob.py 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/jupyter_ydoc/yblob.py 2024-10-29 14:28:59.000000000 +0100 @@ -1,11 +1,10 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. -import base64 from functools import partial -from typing import Any, Callable, Optional, Union +from typing import Any, Callable, Optional -from pycrdt import Doc, Map +from pycrdt import Awareness, Doc, Map from .ybasedoc import YBaseDoc @@ -13,10 +12,7 @@ class YBlob(YBaseDoc): """ Extends :class:`YBaseDoc`, and represents a blob document. - It is currently encoded as base64 because of: - https://github.com/y-crdt/ypy/issues/108#issuecomment-1377055465 - The Y document can be set from bytes or from str, in which case it is assumed to be encoded as - base64. + The Y document is set from bytes. Schema: @@ -28,14 +24,17 @@ } """ - def __init__(self, ydoc: Optional[Doc] = None): + def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] = None): """ Constructs a YBlob. :param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided. :type ydoc: :class:`pycrdt.Doc`, optional. + :param awareness: The :class:`pycrdt.Awareness` that shares non persistent data + between clients. + :type awareness: :class:`pycrdt.Awareness`, optional. """ - super().__init__(ydoc) + super().__init__(ydoc, awareness) self._ysource = self._ydoc.get("source", type=Map) self.undo_manager.expand_scope(self._ysource) @@ -47,7 +46,7 @@ :return: Document's version. :rtype: str """ - return "1.0.0" + return "2.0.0" def get(self) -> bytes: """ @@ -56,18 +55,16 @@ :return: Document's content. :rtype: bytes """ - return base64.b64decode(self._ysource.get("base64", "").encode()) + return self._ysource.get("bytes", b"") - def set(self, value: Union[bytes, str]) -> None: + def set(self, value: bytes) -> None: """ Sets the content of the document. :param value: The content of the document. - :type value: Union[bytes, str] + :type value: bytes """ - if isinstance(value, bytes): - value = base64.b64encode(value).decode() - self._ysource["base64"] = value + self._ysource["bytes"] = value def observe(self, callback: Callable[[str, Any], None]) -> None: """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/jupyter_ydoc/ynotebook.py new/jupyter_ydoc-3.0.0/jupyter_ydoc/ynotebook.py --- old/jupyter_ydoc-2.1.1/jupyter_ydoc/ynotebook.py 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/jupyter_ydoc/ynotebook.py 2024-10-29 14:28:59.000000000 +0100 @@ -6,7 +6,7 @@ from typing import Any, Callable, Dict, Optional from uuid import uuid4 -from pycrdt import Array, Doc, Map, Text +from pycrdt import Array, Awareness, Doc, Map, Text from .utils import cast_all from .ybasedoc import YBaseDoc @@ -38,6 +38,7 @@ "cell_type": str, "source": YText, "metadata": YMap, + "execution_state": str, "execution_count": Int | None, "outputs": [] | None, "attachments": {} | None @@ -46,14 +47,17 @@ } """ - def __init__(self, ydoc: Optional[Doc] = None): + def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] = None): """ Constructs a YNotebook. :param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided. :type ydoc: :class:`pycrdt.Doc`, optional. + :param awareness: The :class:`pycrdt.Awareness` that shares non persistent data + between clients. + :type awareness: :class:`pycrdt.Awareness`, optional. """ - super().__init__(ydoc) + super().__init__(ydoc, awareness) self._ymeta = self._ydoc.get("meta", type=Map) self._ycells = self._ydoc.get("cells", type=Array) self.undo_manager.expand_scope(self._ycells) @@ -66,7 +70,7 @@ :return: Document's version. :rtype: str """ - return "1.0.0" + return "2.0.0" @property def ycells(self): @@ -100,6 +104,7 @@ """ meta = self._ymeta.to_py() cell = self._ycells[index].to_py() + cell.pop("execution_state", None) cast_all(cell, float, int) # cells coming from Yjs have e.g. execution_count as float if "id" in cell and meta["nbformat"] == 4 and meta["nbformat_minor"] <= 4: # strip cell IDs if we have notebook format 4.0-4.4 @@ -158,7 +163,13 @@ if "attachments" in cell and not cell["attachments"]: del cell["attachments"] elif cell_type == "code": - cell["outputs"] = Array(cell.get("outputs", [])) + outputs = cell.get("outputs", []) + for idx, output in enumerate(outputs): + if output.get("output_type") == "stream": + output["text"] = Array(output.get("text", [])) + outputs[idx] = Map(output) + cell["outputs"] = Array(outputs) + cell["execution_state"] = "idle" return Map(cell) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/jupyter_ydoc/yunicode.py new/jupyter_ydoc-3.0.0/jupyter_ydoc/yunicode.py --- old/jupyter_ydoc-2.1.1/jupyter_ydoc/yunicode.py 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/jupyter_ydoc/yunicode.py 2024-10-29 14:28:59.000000000 +0100 @@ -4,7 +4,7 @@ from functools import partial from typing import Any, Callable, Optional -from pycrdt import Doc, Text +from pycrdt import Awareness, Doc, Text from .ybasedoc import YBaseDoc @@ -23,14 +23,17 @@ } """ - def __init__(self, ydoc: Optional[Doc] = None): + def __init__(self, ydoc: Optional[Doc] = None, awareness: Optional[Awareness] = None): """ Constructs a YUnicode. :param ydoc: The :class:`pycrdt.Doc` that will hold the data of the document, if provided. :type ydoc: :class:`pycrdt.Doc`, optional. + :param awareness: The :class:`pycrdt.Awareness` that shares non persistent data + between clients. + :type awareness: :class:`pycrdt.Awareness`, optional. """ - super().__init__(ydoc) + super().__init__(ydoc, awareness) self._ysource = self._ydoc.get("source", type=Text) self.undo_manager.expand_scope(self._ysource) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/pyproject.toml new/jupyter_ydoc-3.0.0/pyproject.toml --- old/jupyter_ydoc-2.1.1/pyproject.toml 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/pyproject.toml 2024-10-29 14:28:59.000000000 +0100 @@ -9,11 +9,11 @@ name = "jupyter-ydoc" dynamic = ["version"] description = "Document structures for collaborative editing using Ypy" -requires-python = ">=3.7" -keywords = ["jupyter", "ypy"] +requires-python = ">=3.8" +keywords = ["jupyter", "pycrdt", "yjs"] dependencies = [ "importlib_metadata >=3.6; python_version<'3.10'", - "pycrdt >=0.9.0,<0.10.0", + "pycrdt >=0.10.1,<0.11.0", ] [[project.authors]] @@ -31,7 +31,7 @@ "pytest", "pytest-asyncio", "websockets >=10.0", - "pycrdt-websocket >=0.14.1,<0.15.0", + "pycrdt-websocket >=0.15.0,<0.16.0", ] docs = [ "sphinx", @@ -82,5 +82,15 @@ [tool.jupyter-releaser.options] version_cmd = "hatch version" -[tool.flake8] -max-line-length = 100 +[tool.ruff] +line-length = 100 +lint.select = [ + "ASYNC", # flake8-async + "E", "F", "W", # default Flake8 + "G", # flake8-logging-format + "I", # isort + "ISC", # flake8-implicit-str-concat + "PGH", # pygrep-hooks + "RUF100", # unused noqa (yesqa) + "UP", # pyupgrade +] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/tests/conftest.py new/jupyter_ydoc-3.0.0/tests/conftest.py --- old/jupyter_ydoc-2.1.1/tests/conftest.py 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/tests/conftest.py 2024-10-29 14:28:59.000000000 +0100 @@ -7,7 +7,7 @@ import pytest from pycrdt_websocket import WebsocketServer -from websockets import serve # type: ignore +from websockets import serve # workaround until these PRs are merged: # - https://github.com/yjs/y-websocket/pull/104 @@ -43,6 +43,10 @@ @pytest.fixture def yjs_client(request): client_id = request.param - p = subprocess.Popen(f"yarn node {here / 'yjs_client_'}{client_id}.js", shell=True) + p = subprocess.Popen(["node", f"{here / 'yjs_client_'}{client_id}.js"]) yield p - p.kill() + p.terminate() + try: + p.wait(timeout=10) + except Exception: + p.kill() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/tests/files/nb0.ipynb new/jupyter_ydoc-3.0.0/tests/files/nb0.ipynb --- old/jupyter_ydoc-2.1.1/tests/files/nb0.ipynb 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/tests/files/nb0.ipynb 2024-10-29 14:28:59.000000000 +0100 @@ -1,43 +1,45 @@ { - "cells": [ - { - "cell_type": "code", - "source": [ - "print('Hello, World!')" - ], - "metadata": {}, - "outputs": [], - "execution_count": null, - "id": null - }, - { - "cell_type": "code", - "source": "print('Hello, World!')", - "metadata": {}, - "outputs": [], - "execution_count": null, - "id": null - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.2" - } - }, - "nbformat": 4, - "nbformat_minor": 5 + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "7fb27b941602401d91542211134fc71a", + "metadata": {}, + "outputs": [], + "source": [ + "print(\"Hello, World!\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "acae54e37e7d407bbb7b55eff062a284", + "metadata": {}, + "outputs": [], + "source": [ + "print(\"Hello, World!\")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.2" + } + }, + "nbformat": 4, + "nbformat_minor": 5 } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/tests/files/nb1.ipynb new/jupyter_ydoc-3.0.0/tests/files/nb1.ipynb --- old/jupyter_ydoc-2.1.1/tests/files/nb1.ipynb 1970-01-01 01:00:00.000000000 +0100 +++ new/jupyter_ydoc-3.0.0/tests/files/nb1.ipynb 2024-10-29 14:28:59.000000000 +0100 @@ -0,0 +1,43 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "4166c837-41c7-4ada-b86e-fd9a7720a409", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello," + ] + } + ], + "source": [ + "print(\"Hello,\", end=\"\")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.3" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/tests/files/plotly_renderer.ipynb new/jupyter_ydoc-3.0.0/tests/files/plotly_renderer.ipynb --- old/jupyter_ydoc-2.1.1/tests/files/plotly_renderer.ipynb 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/tests/files/plotly_renderer.ipynb 2024-10-29 14:28:59.000000000 +0100 @@ -867,10 +867,8 @@ ], "source": [ "import plotly.graph_objects as go\n", - "fig = go.Figure(\n", - " data=[go.Bar(y=[2, 1, 3])],\n", - " layout_title_text=\"A Figure Displayed with fig.show()\"\n", - ")\n", + "\n", + "fig = go.Figure(data=[go.Bar(y=[2, 1, 3])], layout_title_text=\"A Figure Displayed with fig.show()\")\n", "fig.show()" ] } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/tests/test_pycrdt_yjs.py new/jupyter_ydoc-3.0.0/tests/test_pycrdt_yjs.py --- old/jupyter_ydoc-2.1.1/tests/test_pycrdt_yjs.py 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/tests/test_pycrdt_yjs.py 2024-10-29 14:28:59.000000000 +0100 @@ -8,7 +8,7 @@ from anyio import Event, create_task_group, move_on_after from pycrdt import Doc, Map from pycrdt_websocket import WebsocketProvider -from websockets import connect # type: ignore +from websockets import connect from jupyter_ydoc import YNotebook from jupyter_ydoc.utils import cast_all @@ -74,6 +74,31 @@ assert ytest.source == nb +@pytest.mark.asyncio +@pytest.mark.parametrize("yjs_client", "1", indirect=True) +async def test_ypy_yjs_1(yws_server, yjs_client): + ydoc = Doc() + ynotebook = YNotebook(ydoc) + nb = stringify_source(json.loads((files_dir / "nb1.ipynb").read_text())) + ynotebook.source = nb + async with connect("ws://localhost:1234/my-roomname") as websocket, WebsocketProvider( + ydoc, websocket + ): + output_text = ynotebook.ycells[0]["outputs"][0]["text"] + assert output_text.to_py() == ["Hello,"] + event = Event() + + def callback(_event): + event.set() + + output_text.observe(callback) + + with move_on_after(10): + await event.wait() + + assert output_text.to_py() == ["Hello,", " World!"] + + def test_plotly_renderer(): """This test checks in particular that the type cast is not breaking the data.""" ydoc = Doc() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/tests/test_ydocs.py new/jupyter_ydoc-3.0.0/tests/test_ydocs.py --- old/jupyter_ydoc-2.1.1/tests/test_ydocs.py 2024-07-10 12:52:16.000000000 +0200 +++ new/jupyter_ydoc-3.0.0/tests/test_ydocs.py 2024-10-29 14:28:59.000000000 +0100 @@ -1,7 +1,29 @@ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. -from jupyter_ydoc import YNotebook +from pycrdt import Awareness, Doc + +from jupyter_ydoc import YBlob, YNotebook + + +def test_yblob(): + yblob = YBlob() + assert yblob.get() == b"" + yblob.set(b"012") + assert yblob.get() == b"012" + changes = [] + + def callback(topic, event): + print(topic, event) + changes.append((topic, event)) + + yblob.observe(callback) + yblob.set(b"345") + assert len(changes) == 1 + topic, event = changes[0] + assert topic == "source" + assert event.keys["bytes"]["oldValue"] == b"012" + assert event.keys["bytes"]["newValue"] == b"345" def test_ynotebook_undo_manager(): @@ -33,3 +55,13 @@ ynotebook.undo_manager.undo() assert len(ynotebook.ycells) == 0 assert not ynotebook.undo_manager.can_undo() + + +def test_awareness(): + yblob = YBlob() + assert yblob.awareness is None + + ydoc = Doc() + awareness = Awareness(ydoc) + yblob = YBlob(ydoc, awareness) + assert yblob.awareness == awareness diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_ydoc-2.1.1/tests/yjs_client_1.js new/jupyter_ydoc-3.0.0/tests/yjs_client_1.js --- old/jupyter_ydoc-2.1.1/tests/yjs_client_1.js 1970-01-01 01:00:00.000000000 +0100 +++ new/jupyter_ydoc-3.0.0/tests/yjs_client_1.js 2024-10-29 14:28:59.000000000 +0100 @@ -0,0 +1,23 @@ +/* + * Copyright (c) Jupyter Development Team. + * Distributed under the terms of the Modified BSD License. + */ + +import { YNotebook } from '@jupyter/ydoc' +import { WebsocketProvider } from 'y-websocket' +import ws from 'ws' + +const notebook = new YNotebook() + +const wsProvider = new WebsocketProvider( + 'ws://localhost:1234', 'my-roomname', + notebook.ydoc, + { WebSocketPolyfill: ws } +) + +wsProvider.on('sync', (isSynced) => { + const cell = notebook.getCell(0) + const youtput = cell.youtputs.get(0) + const text = youtput.get('text') + text.insert(1, [' World!']) +}) ++++++ jupyter_ydoc-2.1.1-gh.tar.gz -> jupyter_ydoc-3.0.0.tar.gz ++++++ ++++ 6313 lines of diff (skipped) ++++++ node_modules.tar.xz ++++++ /work/SRC/openSUSE:Factory/python-jupyter-ydoc/node_modules.tar.xz /work/SRC/openSUSE:Factory/.python-jupyter-ydoc.new.2017/node_modules.tar.xz differ: char 15, line 1