Skip to content

Migrate to Jupyter Lab v4#135

Draft
gjmooney wants to merge 8 commits into
maartenbreddels:masterfrom
gjmooney:v4_migrate
Draft

Migrate to Jupyter Lab v4#135
gjmooney wants to merge 8 commits into
maartenbreddels:masterfrom
gjmooney:v4_migrate

Conversation

@gjmooney

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread js/package-lock.json

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that you are switching from npm to yarn we may want to use yarn in the package.json scripts

@maartenbreddels maartenbreddels left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

thank you for the work!
I would prefer however if all unrelated changes are not pushed to this branch.
For ipyreact we added styling like this: widgetti/ipyreact#51
using ruff + prettier but that should not go into this PR.
Also, does a build with jupyterlab4 make ipywebrtc still work in jupyterlab3.x?
I'm happy to have formatting/style fixes btw, but not mixed with other PR's :)
Hope I don't discouraged you too much, feel free to push back.

Cheers,

Maarten

Comment on lines +26 to +66
- name: Checkout
uses: actions/checkout@v2

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: dev_environment.yml
condarc: |
dependencies:
- python==${{ matrix.python-version }}

- name: Test flake8
run: flake8 ipywebrtc --ignore=E501,F405

- name: Install ipywebrtc
run: pip install .

- name: Check installation files
run: |
test -d $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-webrtc
test -f $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-webrtc/extension.js
test -f $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-webrtc/index.js
test -d $CONDA_PREFIX/share/jupyter/labextensions/jupyter-webrtc
test -f $CONDA_PREFIX/share/jupyter/labextensions/jupyter-webrtc/package.json

- name: Check nbextension and labextension
run: |
jupyter labextension list 2>&1 | grep -ie "jupyter-webrtc.*enabled.*ok" -

- name: Run js tests
run: |
npm install
npm run test
working-directory: js

- name: Build docs (Only on MacOS for build speed)
if: matrix.os == 'macos-latest'
run: |
cd docs/source/
sphinx-build . _build/html
cd ../..

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid unneeded changes/reformatting, or put them in a separate PR or top commit first. This makes tracking changes much easier.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand what you're saying, I can do a new PR for style changes.

Comment on lines +71 to +91
- name: Checkout
uses: actions/checkout@v2

- name: Checkout
uses: actions/checkout@v2

- name: Install Conda environment with Micromamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-name: ipywebrtc-dev
environment-file: dev_environment.yml
python-version: ${{ matrix.python-version }}
mamba-version: "*"
auto-activate-base: false
channels: conda-forge

- name: Build packages
run: |
python setup.py sdist bdist_wheel
cd dist
sha256sum * | tee SHA256SUMS
- name: Upload builds
uses: actions/upload-artifact@v2
with:
name: dist ${{ github.run_number }}
path: ./dist
- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: dev_environment.yml
condarc: |
dependencies:
- python==${{ matrix.python-version }}

- name: Build packages
run: |
python setup.py sdist bdist_wheel
cd dist
sha256sum * | tee SHA256SUMS
- name: Upload builds
uses: actions/upload-artifact@v2
with:
name: dist ${{ github.run_number }}
path: ./dist

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, very difficult to see what actually changed and what is related to the intention or the PR

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's easier to review hiding the whitespaces changes https://github.com/maartenbreddels/ipywebrtc/pull/135/files?diff=split&w=1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

w=1 is the query parameter

Comment on lines +103 to +106
- python: "3.6"
dist: "ipywebrtc*.tar.gz"
- python: "3.9"
dist: "ipywebrtc*.whl"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't that bad, because it's not mixed with other changes, but adds noise.

Comment thread js/test/dummy-manager.ts
Comment on lines +5 to +9
import * as services from "@jupyterlab/services";
import * as Backbone from "backbone";
import * as widgets from "@jupyter-widgets/controls";
import * as base from "@jupyter-widgets/base";
import * as sinon from "sinon";

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the changes in this file are not needed, although I welcome a style fix :)

@flokli

flokli commented Apr 30, 2025

Copy link
Copy Markdown

@maartenbreddels

Also, does a build with jupyterlab4 make ipywebrtc still work in jupyterlab3.x?

https://jupyterlab.readthedocs.io/en/latest/extension/extension_migration.html#jupyterlab-3-x-to-4-x says the following:

Because of significant type changes from JupyterLab 3.x to 4.x, we recommend publishing a new major version of your extension to work with each major version of JupyterLab. For examples of extensions that use different major versions for Lab 3 and Lab 4, see jupyterlab-vim and jupyter-ai.

I've been running into some incompatibility issues and Javascript errors when packaging this for nixpkgs, which uses Jupyter Lab v4. I'd be happy to take up the changes from this PR, split up the formatting changes into separate commits, but I'd probably suggest to switch to v4. People stuck with v3 can still pin a old release.

@flokli

flokli commented Jun 17, 2025

Copy link
Copy Markdown

Poke :-) @maartenbreddels, how do you want to proceed with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants