Skip to content

Commit d1c36ef

Browse files
authored
Merge pull request #3 from jtpio/lab4-update
Update to JupyterLab 4 template
2 parents 84c3523 + be0d3e2 commit d1c36ef

27 files changed

+6599
-7018
lines changed

.copier-answers.yml

+14
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.6
3+
_src_path: https://github.com/jupyterlab/extension-template
4+
author_email: [email protected]
5+
author_name: Martin Renou
6+
has_binder: true
7+
has_settings: false
8+
kind: theme
9+
labextension_name: jupyterlab-day
10+
project_short_description: Dark theme for JupyterLab
11+
python_name: jupyterlab_day
12+
repository: https://github.com/martinRenou/jupyterlab-day.git
13+
test: false
14+

.eslintignore

-5
This file was deleted.

.eslintrc.js

-39
This file was deleted.

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

+4-21
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

+48-23
Original file line numberDiff line numberDiff line change
@@ -6,64 +6,89 @@ on:
66
pull_request:
77
branches: '*'
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
build:
1115
runs-on: ubuntu-latest
16+
1217
steps:
1318
- name: Checkout
14-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
1520

1621
- name: Base Setup
17-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
22+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
1823

1924
- name: Install dependencies
20-
run: python -m pip install -U jupyterlab~=3.1 check-manifest
25+
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
2126

22-
- name: Build the extension
27+
- name: Lint the extension
2328
run: |
2429
set -eux
2530
jlpm
26-
jlpm lint:check
27-
python -m pip install .
31+
jlpm run lint:check
2832
33+
- name: Build the extension
34+
run: |
35+
set -eux
36+
python -m pip install .[test]
37+
38+
jupyter labextension list
2939
jupyter labextension list 2>&1 | grep -ie "jupyterlab-day.*OK"
30-
python -m jupyterlab.browser_check
3140
32-
check-manifest -v
41+
# TODO: re-enable: https://github.com/jupyterlab/jupyterlab/issues/17079
42+
# python -m jupyterlab.browser_check
43+
44+
- name: Package the extension
45+
run: |
46+
set -eux
3347
3448
pip install build
35-
python -m build --sdist
36-
cp dist/*.tar.gz myextension.tar.gz
49+
python -m build
3750
pip uninstall -y "jupyterlab_day" jupyterlab
38-
rm -rf myextension
3951
40-
- uses: actions/upload-artifact@v2
52+
- name: Upload extension packages
53+
uses: actions/upload-artifact@v4
4154
with:
42-
name: myextension-sdist
43-
path: myextension.tar.gz
55+
name: extension-artifacts
56+
path: dist/jupyterlab_day*
57+
if-no-files-found: error
4458

4559
test_isolated:
4660
needs: build
4761
runs-on: ubuntu-latest
4862

4963
steps:
50-
- name: Checkout
51-
uses: actions/checkout@v2
5264
- name: Install Python
53-
uses: actions/setup-python@v2
65+
uses: actions/setup-python@v5
5466
with:
55-
python-version: '3.8'
67+
python-version: '3.9'
5668
architecture: 'x64'
57-
- uses: actions/download-artifact@v2
69+
- uses: actions/download-artifact@v4
5870
with:
59-
name: myextension-sdist
71+
name: extension-artifacts
6072
- name: Install and Test
6173
run: |
6274
set -eux
6375
# Remove NodeJS, twice to take care of system and locally installed node versions.
6476
sudo rm -rf $(which node)
6577
sudo rm -rf $(which node)
66-
pip install myextension.tar.gz
67-
pip install jupyterlab
78+
79+
pip install "jupyterlab>=4.0.0,<5" jupyterlab_day*.whl
80+
81+
82+
jupyter labextension list
6883
jupyter labextension list 2>&1 | grep -ie "jupyterlab-day.*OK"
69-
python -m jupyterlab.browser_check --no-chrome-test
84+
python -m jupyterlab.browser_check --no-browser-test
85+
86+
87+
check_links:
88+
name: Check Links
89+
runs-on: ubuntu-latest
90+
timeout-minutes: 15
91+
steps:
92+
- uses: actions/checkout@v4
93+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
94+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1

.github/workflows/check-release.yml

+11-44
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,30 @@
11
name: Check Release
22
on:
33
push:
4-
branches:
5-
- main
4+
branches: ["main"]
65
pull_request:
7-
branches:
8-
- main
6+
branches: ["*"]
97

10-
permissions:
11-
contents: write
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
1211

1312
jobs:
1413
check_release:
1514
runs-on: ubuntu-latest
1615
steps:
1716
- 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
51-
- name: Install Dependencies
52-
run: |
53-
pip install .
17+
uses: actions/checkout@v4
18+
- name: Base Setup
19+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
5420
- name: Check Release
55-
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
21+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
5622
with:
23+
5724
token: ${{ secrets.GITHUB_TOKEN }}
5825

5926
- name: Upload Distributions
60-
uses: actions/upload-artifact@v2
27+
uses: actions/upload-artifact@v4
6128
with:
6229
name: jupyterlab_day-releaser-dist-${{ github.run_number }}
6330
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

+48
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)