Skip to content

Commit a7d939c

Browse files
darpan097darpantwdfcollonval
authored
Added support for Jupyterlab 4 (#60)
* ran copier migration script * reverted versions for lumino widgets * working version * added conda remove command * refactored jlab_enhanced_launcher to jlab-enhanced-launcher * reverted change * fix attemp - 1 * fixed launcher paths * Update README.md with suggestion Co-authored-by: Frédéric Collonval <fcollonval@gmail.com> * Update binder/environment.yml with suggestion Co-authored-by: Frédéric Collonval <fcollonval@gmail.com> * Remove reading package.json in python package * Update package.json with suggestion Co-authored-by: Frédéric Collonval <fcollonval@gmail.com> * Update schema/plugin.json with suggestion Co-authored-by: Frédéric Collonval <fcollonval@gmail.com> * jlpm lint * Update package.json Co-authored-by: Frédéric Collonval <fcollonval@gmail.com> * Update package.json Co-authored-by: Frédéric Collonval <fcollonval@gmail.com> * Update package.json Co-authored-by: Frédéric Collonval <fcollonval@gmail.com> * - removed "skipLibCheck": true - executed jlpm install * Fix remaining build and lint issues --------- Co-authored-by: dbansal <dbansal@twd.nl> Co-authored-by: Frédéric Collonval <fcollonval@gmail.com> Co-authored-by: Frédéric Collonval <fcollonval@users.noreply.github.com>
1 parent 49d9fe4 commit a7d939c

33 files changed

+6424
-6950
lines changed

.copier-answers.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: v4.3.8
3+
_src_path: https://github.com/jupyterlab/extension-template
4+
author_email: ''
5+
author_name: Frederic COLLONVAL
6+
has_binder: true
7+
has_settings: true
8+
kind: frontend
9+
labextension_name: '@jlab-enhanced/launcher'
10+
project_short_description: A enhanced launcher for JupyterLab
11+
python_name: jlab_enhanced_launcher
12+
repository: https://github.com/jupyterlab-contrib/jlab-enhanced-launcher.git
13+
test: false
14+

.eslintignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 38 deletions
This file was deleted.

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

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
1-
# Reference https://mybinder.readthedocs.io/en/latest/howto/gh-actions-badges.html
2-
name: Binder Badge
3-
4-
on:
5-
pull_request_target:
6-
types: [opened]
7-
8-
permissions:
9-
pull-requests: write
10-
11-
jobs:
12-
binder:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- name: comment on PR with Binder link
16-
uses: actions/github-script@v3
17-
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 instance 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 }}
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

Lines changed: 76 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -2,107 +2,91 @@ name: Build
22

33
on:
44
push:
5-
branches: master
5+
branches: main
66
pull_request:
7+
branches: '*'
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
712

813
jobs:
914
build:
1015
runs-on: ubuntu-latest
16+
1117
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v2
14-
- name: Install node
15-
uses: actions/setup-node@v1
16-
with:
17-
node-version: '14.x'
18-
- name: Install Python
19-
uses: actions/setup-python@v2
20-
with:
21-
python-version: '3.9'
22-
architecture: 'x64'
23-
24-
- name: Setup pip cache
25-
uses: actions/cache@v2
26-
with:
27-
path: ~/.cache/pip
28-
key: pip-3.8-${{ hashFiles('package.json') }}
29-
restore-keys: |
30-
pip-3.8-
31-
pip-
32-
33-
- name: Get yarn cache directory path
34-
id: yarn-cache-dir-path
35-
run: echo "::set-output name=dir::$(yarn cache dir)"
36-
- name: Setup yarn cache
37-
uses: actions/cache@v2
38-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
39-
with:
40-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
41-
key: yarn-${{ hashFiles('**/yarn.lock') }}
42-
restore-keys: |
43-
yarn-
44-
45-
- name: Install dependencies
46-
run: |
47-
set -eux
48-
sudo apt-get update
49-
sudo apt-get install ripgrep
50-
51-
python -m pip install -U jupyterlab~=3.1 check-manifest
52-
53-
- name: Build the extension
54-
run: |
55-
set -eux
56-
jlpm
57-
jlpm run eslint:check
58-
python -m pip install .
59-
60-
- name: Check JupyterLab installation
61-
run: |
62-
set -eux
63-
64-
jupyter labextension list
65-
jupyter labextension list 2>&1 | grep -ie "@jlab-enhanced/launcher.*OK"
66-
python -m jupyterlab.browser_check
67-
68-
- name: Build package
69-
run: |
70-
set -eux
71-
check-manifest -v
72-
73-
pip install build
74-
python -m build --sdist
75-
cp dist/*.tar.gz myextension.tar.gz
76-
pip uninstall -y myextension jupyterlab
77-
rm -rf myextension
78-
79-
- uses: actions/upload-artifact@v2
80-
with:
81-
name: myextension-sdist
82-
path: myextension.tar.gz
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Base Setup
22+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
23+
24+
- name: Install dependencies
25+
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
26+
27+
- name: Lint the extension
28+
run: |
29+
set -eux
30+
jlpm
31+
jlpm run lint:check
32+
33+
- name: Build the extension
34+
run: |
35+
set -eux
36+
python -m pip install .[test]
37+
38+
jupyter labextension list
39+
jupyter labextension list 2>&1 | grep -ie "@jlab-enhanced/launcher.*OK"
40+
python -m jupyterlab.browser_check
41+
42+
- name: Package the extension
43+
run: |
44+
set -eux
45+
46+
pip install build
47+
python -m build
48+
pip uninstall -y "jlab-enhanced-launcher" jupyterlab
49+
50+
- name: Upload extension packages
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: extension-artifacts
54+
path: dist/jlab_enhanced_launcher*
55+
if-no-files-found: error
8356

8457
test_isolated:
8558
needs: build
8659
runs-on: ubuntu-latest
8760

8861
steps:
89-
- name: Checkout
90-
uses: actions/checkout@v2
91-
- name: Install Python
92-
uses: actions/setup-python@v2
93-
with:
94-
python-version: '3.8'
95-
architecture: 'x64'
96-
- uses: actions/download-artifact@v2
97-
with:
98-
name: myextension-sdist
99-
- name: Install and Test
100-
run: |
101-
set -eux
102-
# Remove NodeJS, twice to take care of system and locally installed node versions.
103-
sudo rm -rf $(which node)
104-
sudo rm -rf $(which node)
105-
pip install myextension.tar.gz
106-
pip install jupyterlab
107-
jupyter labextension list 2>&1 | grep -ie "@jlab-enhanced/launcher.*OK"
108-
python -m jupyterlab.browser_check --no-chrome-test
62+
- name: Install Python
63+
uses: actions/setup-python@v5
64+
with:
65+
python-version: '3.9'
66+
architecture: 'x64'
67+
- uses: actions/download-artifact@v4
68+
with:
69+
name: extension-artifacts
70+
- name: Install and Test
71+
run: |
72+
set -eux
73+
# Remove NodeJS, twice to take care of system and locally installed node versions.
74+
sudo rm -rf $(which node)
75+
sudo rm -rf $(which node)
76+
77+
pip install "jupyterlab>=4.0.0,<5" jlab_enhanced_launcher*.whl
78+
79+
80+
jupyter labextension list
81+
jupyter labextension list 2>&1 | grep -ie "@jlab-enhanced/launcher.*OK"
82+
python -m jupyterlab.browser_check --no-browser-test
83+
84+
85+
check_links:
86+
name: Check Links
87+
runs-on: ubuntu-latest
88+
timeout-minutes: 15
89+
steps:
90+
- uses: actions/checkout@v4
91+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
92+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1

.github/workflows/check-release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches: ["main"]
5+
pull_request:
6+
branches: ["*"]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
check_release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Base Setup
19+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
20+
- name: Check Release
21+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
22+
with:
23+
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Upload Distributions
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: jlab_enhanced_launcher-releaser-dist-${{ github.run_number }}
30+
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: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
# silent:
16+
# description: "Set a placeholder in the changelog and don't publish the release."
17+
# required: false
18+
# type: boolean
19+
since:
20+
description: "Use PRs with activity since this date or git reference"
21+
required: false
22+
since_last_stable:
23+
description: "Use PRs with activity since the last stable git tag"
24+
required: false
25+
type: boolean
26+
jobs:
27+
prep_release:
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: write
31+
steps:
32+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
33+
34+
- name: Prep Release
35+
id: prep-release
36+
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
37+
with:
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
version_spec: ${{ github.event.inputs.version_spec }}
40+
# silent: ${{ github.event.inputs.silent }}
41+
post_version_spec: ${{ github.event.inputs.post_version_spec }}
42+
branch: ${{ github.event.inputs.branch }}
43+
since: ${{ github.event.inputs.since }}
44+
since_last_stable: ${{ github.event.inputs.since_last_stable }}
45+
46+
- name: "** Next Step **"
47+
run: |
48+
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}"

0 commit comments

Comments
 (0)