Skip to content

7.x: Allow building against JupyterLab 4 #1666

7.x: Allow building against JupyterLab 4

7.x: Allow building against JupyterLab 4 #1666

Workflow file for this run

name: Build jupyterlab_widgets
on:
push:
branches: master
pull_request:
branches: '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install node
uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: '3.8'
architecture: 'x64'
- name: Cache pip on Linux
uses: actions/cache@v1
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn
uses: actions/cache@v1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: |
python -m pip install jupyterlab~=4.0
python -m pip install jupyter_packaging~=0.7.9
- name: Build the extension
run: |
jlpm install --frozen-lockfile
jlpm run build
jlpm run build:examples
# First install the dev jupyterlab_widgets, since it is a dependency
pushd jupyterlab_widgets
pwd
pip install -e .
jupyter labextension develop . --overwrite
jupyter labextension list
popd
# Finally, install the base ipywidgets package now that we have the jupyterlab_widgets dependency
pip install -e .[test]
- name: Run Python tests
run: pytest .
- name: Run JS tests
run: |
pushd packages/base
jlpm run test:unit:firefox:headless
popd
pushd packages/controls
jlpm run test:unit:firefox:headless
popd
pushd packages/html-manager
jlpm run test:unit:firefox:headless
popd
pushd examples/web1
jlpm run test:firefox:headless
popd