Skip to content

Commit 6a059a6

Browse files
Migrate to JupyterLab 4 (#29)
* Update to JupyterLab 4 * Add hatch builder for jupyter * Update webpack options * Lint and prettify * Link webpack config * Remove MANIFEST * Remove workspaces * Restore yarn locks * Fix file browser * Enable syntax highlighting * Prettify
1 parent 0f5eece commit 6a059a6

33 files changed

+16069
-11131
lines changed

.github/workflows/binder-on-pr.yml

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,14 @@
1-
# Reference https://mybinder.readthedocs.io/en/latest/howto/gh-actions-badges.html
21
name: Binder Badge
32
on:
43
pull_request_target:
54
types: [opened]
65

7-
permissions:
8-
pull-requests: write
9-
10-
116
jobs:
127
binder:
138
runs-on: ubuntu-latest
9+
permissions:
10+
pull-requests: write
1411
steps:
15-
- name: comment on PR with Binder link
16-
uses: actions/github-script@v3
12+
- uses: jupyterlab/maintainer-tools/.github/actions/binder-link@v1
1713
with:
18-
github-token: ${{secrets.GITHUB_TOKEN}}
19-
script: |
20-
var PR_HEAD_USERREPO = process.env.PR_HEAD_USERREPO;
21-
var PR_HEAD_REF = process.env.PR_HEAD_REF;
22-
github.issues.createComment({
23-
issue_number: context.issue.number,
24-
owner: context.repo.owner,
25-
repo: context.repo.repo,
26-
body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_REF}?urlpath=lab) :point_left: Launch a Binder on branch _${PR_HEAD_USERREPO}/${PR_HEAD_REF}_`
27-
})
28-
env:
29-
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
30-
PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }}
31-
14+
github_token: ${{ secrets.github_token }}

.github/workflows/build.yml

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,21 @@ jobs:
1212

1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1616

1717
- name: Base Setup
1818
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
1919

2020
- name: Install dependencies
21-
run: python -m pip install -U jupyterlab~=3.1 check-manifest
21+
run: |
22+
python -m pip install -U "jupyterlab>=4.0.0,<5"
23+
python -m pip install hatch-jupyter-builder
2224
2325
- name: Lint the extension
2426
run: |
2527
set -eux
2628
jlpm
2729
jlpm run lint:check
28-
2930
- name: Test the extension
3031
run: |
3132
set -eux
@@ -37,20 +38,19 @@ jobs:
3738
python -m pip install .[test]
3839
3940
jupyter labextension list
40-
jupyter labextension list 2>&1 | grep -ie "jupyterlab_urdf.*OK"
41+
jupyter labextension list 2>&1 | grep -ie "jupyterlab-urdf.*OK"
4142
python -m jupyterlab.browser_check
4243
4344
- name: Package the extension
4445
run: |
4546
set -eux
46-
check-manifest -v
4747
4848
pip install build
4949
python -m build
5050
pip uninstall -y "jupyterlab_urdf" jupyterlab
5151
5252
- name: Upload extension packages
53-
uses: actions/upload-artifact@v2
53+
uses: actions/upload-artifact@v3
5454
with:
5555
name: extension-artifacts
5656
path: dist/jupyterlab_urdf*
@@ -62,13 +62,13 @@ jobs:
6262

6363
steps:
6464
- name: Checkout
65-
uses: actions/checkout@v2
65+
uses: actions/checkout@v3
6666
- name: Install Python
67-
uses: actions/setup-python@v2
67+
uses: actions/setup-python@v4
6868
with:
6969
python-version: '3.9'
7070
architecture: 'x64'
71-
- uses: actions/download-artifact@v2
71+
- uses: actions/download-artifact@v3
7272
with:
7373
name: extension-artifacts
7474
- name: Install and Test
@@ -78,12 +78,12 @@ jobs:
7878
sudo rm -rf $(which node)
7979
sudo rm -rf $(which node)
8080
81-
pip install "jupyterlab~=3.1" jupyterlab_urdf*.whl
81+
pip install "jupyterlab>=4.0.0,<5" jupyterlab_urdf*.whl
8282
8383
8484
jupyter labextension list
85-
jupyter labextension list 2>&1 | grep -ie "jupyterlab_urdf.*OK"
86-
python -m jupyterlab.browser_check --no-chrome-test
85+
jupyter labextension list 2>&1 | grep -ie "jupyterlab-urdf.*OK"
86+
python -m jupyterlab.browser_check --no-browser-test
8787
8888
integration-tests:
8989
name: Integration tests
@@ -95,20 +95,20 @@ jobs:
9595

9696
steps:
9797
- name: Checkout
98-
uses: actions/checkout@v2
98+
uses: actions/checkout@v3
9999

100100
- name: Base Setup
101101
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
102102

103103
- name: Download extension package
104-
uses: actions/download-artifact@v2
104+
uses: actions/download-artifact@v3
105105
with:
106106
name: extension-artifacts
107-
107+
108108
- name: Install the extension
109109
run: |
110110
set -eux
111-
python -m pip install "jupyterlab~=3.1" jupyterlab_urdf*.whl
111+
python -m pip install "jupyterlab>=4.0.0,<5" jupyterlab_urdf*.whl
112112
113113
- name: Install dependencies
114114
working-directory: ui-tests
@@ -117,7 +117,7 @@ jobs:
117117
run: jlpm install
118118

119119
- name: Set up browser cache
120-
uses: actions/cache@v2
120+
uses: actions/cache@v3
121121
with:
122122
path: |
123123
${{ github.workspace }}/pw-browsers
@@ -134,9 +134,18 @@ jobs:
134134
135135
- name: Upload Playwright Test report
136136
if: always()
137-
uses: actions/upload-artifact@v2
137+
uses: actions/upload-artifact@v3
138138
with:
139139
name: jupyterlab_urdf-playwright-tests
140140
path: |
141141
ui-tests/test-results
142142
ui-tests/playwright-report
143+
144+
check_links:
145+
name: Check Links
146+
runs-on: ubuntu-latest
147+
timeout-minutes: 15
148+
steps:
149+
- uses: actions/checkout@v3
150+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
151+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1

.github/workflows/check-release.yml

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,29 @@
11
name: Check Release
22
on:
33
push:
4-
branches:
5-
- main
4+
branches: ["main"]
65
pull_request:
7-
branches:
8-
- main
9-
10-
permissions:
11-
contents: write
6+
branches: ["*"]
127

138
jobs:
149
check_release:
1510
runs-on: ubuntu-latest
1611
steps:
1712
- name: Checkout
18-
uses: actions/checkout@v2
19-
- name: Install Python
20-
uses: actions/setup-python@v2
21-
with:
22-
python-version: 3.9
23-
architecture: 'x64'
24-
- name: Install node
25-
uses: actions/setup-node@v2
26-
with:
27-
node-version: '14.x'
28-
29-
30-
- name: Get pip cache dir
31-
id: pip-cache
32-
run: |
33-
echo "::set-output name=dir::$(pip cache dir)"
34-
- name: Cache pip
35-
uses: actions/cache@v1
36-
with:
37-
path: ${{ steps.pip-cache.outputs.dir }}
38-
key: ${{ runner.os }}-pip-${{ hashFiles('package.json') }}
39-
restore-keys: |
40-
${{ runner.os }}-pip-
41-
- name: Cache checked links
42-
uses: actions/cache@v2
43-
with:
44-
path: ~/.cache/pytest-link-check
45-
key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/.md') }}-md-links
46-
restore-keys: |
47-
${{ runner.os }}-linkcheck-
48-
- name: Upgrade packaging dependencies
49-
run: |
50-
pip install --upgrade pip setuptools wheel jupyter-packaging~=0.10 --user
13+
uses: actions/checkout@v3
14+
- name: Base Setup
15+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
5116
- name: Install Dependencies
5217
run: |
53-
pip install .
18+
pip install -e .
5419
- name: Check Release
55-
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
20+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
5621
with:
22+
5723
token: ${{ secrets.GITHUB_TOKEN }}
58-
24+
5925
- name: Upload Distributions
60-
uses: actions/upload-artifact@v2
26+
uses: actions/upload-artifact@v3
6127
with:
6228
name: jupyterlab_urdf-releaser-dist-${{ github.run_number }}
6329
path: .jupyter_releaser_checkout/dist

.github/workflows/enforce-label.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Enforce PR label
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, opened, edited, synchronize]
6+
jobs:
7+
enforce-label:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
pull-requests: write
11+
steps:
12+
- name: enforce-triage-label
13+
uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1

.github/workflows/prep-release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Step 1: Prep Release"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version_spec:
6+
description: "New Version Specifier"
7+
default: "next"
8+
required: false
9+
branch:
10+
description: "The branch to target"
11+
required: false
12+
post_version_spec:
13+
description: "Post Version Specifier"
14+
required: false
15+
since:
16+
description: "Use PRs with activity since this date or git reference"
17+
required: false
18+
since_last_stable:
19+
description: "Use PRs with activity since the last stable git tag"
20+
required: false
21+
type: boolean
22+
jobs:
23+
prep_release:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
27+
28+
- name: Prep Release
29+
id: prep-release
30+
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
31+
with:
32+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
33+
version_spec: ${{ github.event.inputs.version_spec }}
34+
post_version_spec: ${{ github.event.inputs.post_version_spec }}
35+
branch: ${{ github.event.inputs.branch }}
36+
since: ${{ github.event.inputs.since }}
37+
since_last_stable: ${{ github.event.inputs.since_last_stable }}
38+
39+
- name: "** Next Step **"
40+
run: |
41+
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}"

.github/workflows/publish-release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "Step 2: Publish Release"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
branch:
6+
description: "The target branch"
7+
required: false
8+
release_url:
9+
description: "The URL of the draft GitHub release"
10+
required: false
11+
steps_to_skip:
12+
description: "Comma separated list of steps to skip"
13+
required: false
14+
15+
jobs:
16+
publish_release:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
# This is useful if you want to use PyPI trusted publisher
20+
# and NPM provenance
21+
id-token: write
22+
steps:
23+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
24+
25+
- name: Populate Release
26+
id: populate-release
27+
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
28+
with:
29+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
30+
branch: ${{ github.event.inputs.branch }}
31+
release_url: ${{ github.event.inputs.release_url }}
32+
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}
33+
34+
- name: Finalize Release
35+
id: finalize-release
36+
env:
37+
# The following are needed if you use legacy PyPI set up
38+
# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
39+
# PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }}
40+
# TWINE_USERNAME: __token__
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
uses: jupyter-server/jupyter-releaser/.github/actions/finalize-release@v2
43+
with:
44+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
45+
release_url: ${{ steps.populate-release.outputs.release_url }}
46+
47+
- name: "** Next Step **"
48+
if: ${{ success() }}
49+
run: |
50+
echo "Verify the final release"
51+
echo ${{ steps.finalize-release.outputs.release_url }}
52+
53+
- name: "** Failure Message **"
54+
if: ${{ failure() }}
55+
run: |
56+
echo "Failed to Publish the Draft Release Url:"
57+
echo ${{ steps.populate-release.outputs.release_url }}

.github/workflows/update-integration-tests.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ permissions:
99
pull-requests: write
1010

1111
jobs:
12-
13-
1412
update-snapshots:
1513
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, 'please update playwright snapshots') }}
1614
runs-on: ubuntu-latest
1715

1816
steps:
1917
- name: Checkout
20-
uses: actions/checkout@v2
18+
uses: actions/checkout@v3
2119
with:
2220
token: ${{ secrets.GITHUB_TOKEN }}
2321

@@ -29,7 +27,13 @@ jobs:
2927
env:
3028
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3129

30+
- name: Base Setup
31+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
32+
3233
- name: Install dependencies
34+
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
35+
36+
- name: Install extension
3337
run: |
3438
set -eux
3539
jlpm
@@ -41,4 +45,3 @@ jobs:
4145
# Playwright knows how to start JupyterLab server
4246
start_server_script: 'null'
4347
test_folder: ui-tests
44-

0 commit comments

Comments
 (0)