Skip to content

Commit 5b716ed

Browse files
authored
Support JupyterLab 4.0 (#85)
* Upgrade to support JupyterLab 4.0 * Skip check-npm for now * Remove `_version.py` * Restore `check-npm`, remove faulty `prepare` script
1 parent b973aa8 commit 5b716ed

33 files changed

+6963
-4951
lines changed

.eslintrc.js

-39
This file was deleted.

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

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Binder Badge
2+
on:
3+
pull_request_target:
4+
types: [opened]
5+
6+
jobs:
7+
binder:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
pull-requests: write
11+
steps:
12+
- uses: jupyterlab/maintainer-tools/.github/actions/binder-link@v1
13+
with:
14+
github_token: ${{ secrets.github_token }}

.github/workflows/build.yml

+69-19
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,87 @@ name: Build
22

33
on:
44
push:
5-
branches: master
5+
branches: main
66
pull_request:
7+
branches: '*'
78

89
jobs:
910
build:
1011
runs-on: ubuntu-latest
1112

12-
strategy:
13-
matrix:
14-
node-version: [14.x, 16.x]
15-
1613
steps:
1714
- name: Checkout
18-
uses: actions/checkout@v2
19-
- name: Use Node.js ${{ matrix.node-version }}
20-
uses: actions/setup-node@v1
15+
uses: actions/checkout@v3
16+
17+
- name: Base Setup
18+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
19+
20+
- name: Install dependencies
21+
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
22+
23+
- name: Lint the extension
24+
run: |
25+
set -eux
26+
jlpm
27+
jlpm run lint:check
28+
29+
- name: Build the extension
30+
run: |
31+
set -eux
32+
python -m pip install .[test]
33+
34+
jupyter labextension list
35+
jupyter labextension list 2>&1 | grep -ie "@axlair/jupyterlab_vim.*OK"
36+
python -m jupyterlab.browser_check
37+
38+
- name: Package the extension
39+
run: |
40+
set -eux
41+
42+
pip install build
43+
python -m build
44+
pip uninstall -y "jupyterlab_vim" jupyterlab
45+
46+
- name: Upload extension packages
47+
uses: actions/upload-artifact@v3
2148
with:
22-
node-version: ${{ matrix.node-version }}
49+
name: extension-artifacts
50+
path: dist/jupyterlab_vim*
51+
if-no-files-found: error
52+
53+
test_isolated:
54+
needs: build
55+
runs-on: ubuntu-latest
56+
57+
steps:
2358
- name: Install Python
24-
uses: actions/setup-python@v2
59+
uses: actions/setup-python@v4
2560
with:
26-
python-version: '3.7'
61+
python-version: '3.9'
2762
architecture: 'x64'
28-
- name: Install dependencies
29-
run: pip install jupyterlab
30-
- name: Build the extension
63+
- uses: actions/download-artifact@v3
64+
with:
65+
name: extension-artifacts
66+
- name: Install and Test
3167
run: |
32-
jlpm
33-
jlpm run eslint:check
34-
python -m pip install .
35-
jupyter labextension develop . --overwrite
68+
set -eux
69+
# Remove NodeJS, twice to take care of system and locally installed node versions.
70+
sudo rm -rf $(which node)
71+
sudo rm -rf $(which node)
72+
73+
pip install "jupyterlab>=4.0.0,<5" jupyterlab_vim*.whl
3674
75+
76+
jupyter labextension list
3777
jupyter labextension list 2>&1 | grep -ie "@axlair/jupyterlab_vim.*OK"
38-
python -m jupyterlab.browser_check
78+
python -m jupyterlab.browser_check --no-browser-test
79+
80+
81+
check_links:
82+
name: Check Links
83+
runs-on: ubuntu-latest
84+
timeout-minutes: 15
85+
steps:
86+
- uses: actions/checkout@v3
87+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
88+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1

.github/workflows/check-release.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches: ["main"]
5+
pull_request:
6+
branches: ["*"]
7+
8+
jobs:
9+
check_release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Base Setup
15+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
16+
- name: Install Dependencies
17+
run: |
18+
pip install -e .
19+
- name: Check Release
20+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Upload Distributions
25+
uses: actions/upload-artifact@v3
26+
with:
27+
name: jupyterlab_vim-releaser-dist-${{ github.run_number }}
28+
path: .jupyter_releaser_checkout/dist

.github/workflows/enforce-label.yml

+13
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

+41
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

+57
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 }}

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
*.bundle.*
22
lib/
33
node_modules/
4+
*.log
5+
.eslintcache
6+
.stylelintcache
47
*.egg-info/
58
.ipynb_checkpoints
69
*.tsbuildinfo
710
jupyterlab_vim/labextension
11+
# Version file is handled by hatchling
12+
jupyterlab_vim/_version.py
813

914
# Created by https://www.gitignore.io/api/python
1015
# Edit at https://www.gitignore.io/?templates=python
@@ -56,6 +61,7 @@ htmlcov/
5661
.coverage.*
5762
.cache
5863
nosetests.xml
64+
coverage/
5965
coverage.xml
6066
*.cover
6167
.hypothesis/
@@ -110,3 +116,6 @@ dmypy.json
110116

111117
# OSX files
112118
.DS_Store
119+
120+
# Yarn cache
121+
.yarn/

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules
22
**/node_modules
33
**/lib
44
**/package.json
5+
!/package.json
56
jupyterlab_vim

.yarnrc.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
enableImmutableInstalls: true
2+
3+
nodeLinker: node-modules

0 commit comments

Comments
 (0)