Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for building against JupyterLab 4 and Lumino 2 #3752

Merged
merged 2 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: yarn

- name: Install Python
uses: actions/setup-python@v4
with:
Expand All @@ -36,7 +30,7 @@ jobs:

- name: Install build dependencies
run: |
python -m pip install jupyterlab~=3.0 jupyter_packaging~=0.10
python -m pip install jupyterlab jupyter_packaging~=0.10

- name: Install node dependencies
run: |
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/devinstall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: yarn
- name: Install Python
uses: actions/setup-python@v4
with:
Expand All @@ -33,7 +28,7 @@ jobs:

- name: Install dependencies
run: |
python -m pip install notebook jupyterlab~=3.0 jupyter_packaging~=0.10
python -m pip install notebook jupyterlab jupyter_packaging~=0.10
- name: Run the dev-install script
run: |
./dev-install.sh
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Install node
uses: actions/setup-node@v3

- name: Install Python
uses: actions/setup-python@v4
with:
node-version: '18'
cache: yarn
python-version: '3.8'
architecture: 'x64'

- name: Install dependencies
run: |
python -m pip install jupyterlab

- name: yarn install, integrity, lint
run: |
yarn --frozen-lockfile
yarn integrity
yarn lint:check
jlpm --immutable
jlpm integrity
jlpm lint:check
12 changes: 3 additions & 9 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: yarn

- name: Install Python
uses: actions/setup-python@v4
with:
Expand All @@ -42,7 +36,7 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel build jupyterlab~=3.0
python -m pip install --upgrade pip wheel build jupyterlab

- name: Build PyPI distributions for ipywidgets
run: |
Expand All @@ -53,11 +47,11 @@ jobs:

- name: Install node dependencies
run: |
yarn
jlpm

- name: Build JS
run: |
yarn build
jlpm build

- name: Build PyPI distributions for jupyterlab_widgets
run: |
Expand Down
87 changes: 28 additions & 59 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,11 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8
cache: 'pip'
cache-dependency-path: |
**/setup.cfg
**/requirements*.txt
- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: yarn
- name: Install dependencies
run: |
sudo apt-get install -y pandoc
Expand All @@ -39,44 +34,39 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8
cache: 'pip'
cache-dependency-path: |
**/setup.cfg
**/requirements*.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install jupyterlab~=3.0
- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: yarn
python -m pip install jupyterlab==4.0.0
- name: yarn install, build, test
run: |
yarn --frozen-lockfile
yarn build
yarn build:examples
jlpm --immutable
jlpm build
jlpm build:examples

pushd packages/base
yarn test:unit:firefox:headless
jlpm test:unit:firefox:headless
popd

pushd packages/base-manager
yarn test:unit:firefox:headless
jlpm test:unit:firefox:headless
popd

pushd packages/controls
yarn test:unit:firefox:headless
jlpm test:unit:firefox:headless
popd

pushd packages/html-manager
yarn test:unit:firefox:headless
jlpm test:unit:firefox:headless
popd

pushd examples/web1
yarn test:firefox:headless
jlpm test:firefox:headless
popd

env:
Expand All @@ -87,7 +77,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -118,27 +108,22 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8
cache: 'pip'
cache-dependency-path: |
**/setup.cfg
**/requirements*.txt
- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: yarn
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install file://$PWD/python/ipywidgets#egg=ipywidgets[test]
pip install jupyterlab file://$PWD/python/ipywidgets#egg=ipywidgets[test]
- name: Install JS dependencies
run: |
yarn
jlpm
- name: Compare spec with latest version
run: |
python ./packages/schema/generate-spec.py -f markdown spec.md
yarn prettier
jlpm prettier
diff -u ./packages/schema/jupyterwidgetmodels.latest.md ./spec.md

ui-test:
Expand All @@ -159,18 +144,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -U jupyterlab~=3.2 jupyter-packaging~=0.10

- name: Install node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: yarn
python -m pip install -U jupyterlab==4.0.0 jupyter-packaging~=0.10

- name: Build and Install ipywidgets
run: |
yarn --frozen-lockfile
yarn build
jlpm --immutable
jlpm build

- name: Build the extension
run: |
Expand All @@ -187,25 +166,15 @@ jobs:

- name: Install Test Dependencies
run: |
cd ui-tests
yarn --frozen-lockfile
yarn playwright install chromium

- name: Launch JupyterLab
run: |
cd ui-tests
yarn start:detached

- name: Wait for JupyterLab
uses: ifaxity/wait-on-action@v1
with:
resource: http-get://localhost:8888/api
timeout: 20000
jlpm --immutable
npx playwright install chromium
working-directory: ui-tests

- name: Run UI Tests
- name: Execute integration tests
shell: bash -l {0}
working-directory: ui-tests
run: |
cd ui-tests
yarn test
npx playwright test

- name: Upload Playwright Test assets
if: always()
Expand All @@ -225,9 +194,9 @@ jobs:

- name: Update snapshots
if: failure()
working-directory: ui-tests
run: |
cd ui-tests
yarn test:update
jlpm test:update

- name: Upload updated snapshots
if: failure()
Expand Down
4 changes: 0 additions & 4 deletions .yarnrc

This file was deleted.

1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Installing from source is more complicated and requires a developer install,
see the detailed [developer install](docs/source/dev_install.md) instructions.

If you want to install ipywidgets from source, **you will need the
[yarn](https://yarnpkg.com/) package manager version 1.2.1 or later**.
[yarn](https://yarnpkg.com/) package manager version 3 or later**.
To install the latest `main` version from the root directory of the source
code, run `dev-install.sh`. To only build the Python package enter
`pip install -e .`.
Expand Down
17 changes: 4 additions & 13 deletions dev-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,16 @@

# For a clean conda environment please read docs/source/dev_install.md

echo -n "Checking yarn... "
yarn -v
if [ $? -ne 0 ]; then
echo "'yarn -v' failed, therefore yarn is not installed. In order to perform a
developer install of ipywidgets you must have both yarn and pip installed on your
machine! See https://yarnpkg.com/lang/en/docs/install/ for installation instructions."
exit 1
fi

echo -n "Checking pip... "
pip --version
if [ $? -ne 0 ]; then
echo "'pip --version' failed, therefore pip is not installed. In order to perform
a developer install of ipywidgets you must have both pip and yarn installed on
a developer install of ipywidgets you must have pip installed on
your machine! See https://packaging.python.org/installing/ for installation instructions."
exit 1
fi

echo -n "Checking JupyterLab (assuming JupyterLab >=3)... "
echo -n "Checking JupyterLab (assuming JupyterLab >=4)... "
jupyter lab --version 2>/dev/null
if [ $? -ne 0 ]; then
echo "no, skipping installation of widgets for jupyterlab"
Expand All @@ -34,8 +25,8 @@ set -e
nbExtFlags="--sys-prefix $1"

echo -n "Installing and building all yarn packages"
yarn
yarn build
jlpm
jlpm build

echo -n "widgetsnbextension"
pip install -v -e ./python/widgetsnbextension
Expand Down
5 changes: 3 additions & 2 deletions docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ dependencies:
- pip
- packaging
- jupyter-packaging
- jupyterlab >=3,<4
- jupyterlab >=4,<5
- nodejs >=18,<19
# dependencies
- jupyter_client
# docs
- docutils >=0.19
- jupyterlab-myst
# - jupyterlab-myst
- myst-nb >=0.17,<0.18
- pandoc
- pydata-sphinx-theme
Expand All @@ -39,3 +39,4 @@ dependencies:
- python-libarchive-c
- pip:
- jupyterlite ==0.1.0b18
- git+https://github.com/executablebooks/jupyterlab-myst.git@agoose77/feat-jupyterlab-v4-next
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ipykernel
ipyleaflet
jupyter-client
jupyter-packaging
jupyterlab >=3,<4
jupyterlab >=4
jupyterlite ==0.1.0b18
matplotlib
myst-nb >=0.17,<0.18
Expand Down
2 changes: 1 addition & 1 deletion examples/web3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@jupyter-widgets/base": "^6.0.4",
"@jupyter-widgets/controls": "^5.0.5",
"@jupyter-widgets/html-manager": "^1.0.7",
"@jupyterlab/services": "^6.0.0",
"@jupyterlab/services": "^6.0.0 || ^7.0.0",
"codemirror": "^5.48.0",
"font-awesome": "^4.7.0",
"http-server": "^14.0.0"
Expand Down
Loading