Skip to content

Commit 5351915

Browse files
authored
Merge pull request #85 from QuantStack/migrateV4
Migrate to JupyterLab 4
2 parents 4cee142 + 6e91a3b commit 5351915

31 files changed

+11424
-8083
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ setup.py
3333
tsconfig.eslint.json
3434
tsconfig.json
3535
yarn.lock
36+
.yarn.yml
37+
webpack.config.js

.github/workflows/build.yml

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,60 +9,79 @@ on:
99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12+
1213
steps:
1314
- name: Checkout
14-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1516

1617
- name: Base Setup
1718
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
1819

1920
- name: Install dependencies
20-
run: python -m pip install -U jupyterlab~=3.4
21-
22-
- name: Build the extension
21+
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
22+
23+
- name: Lint the extension
2324
run: |
2425
set -eux
2526
jlpm
2627
jlpm eslint:check
28+
29+
- name: Build the extension
30+
run: |
31+
set -eux
2732
python -m pip install .
2833
2934
jupyter labextension list
3035
jupyter labextension list 2>&1 | grep -ie "jupyterlab-blockly-extension.*OK"
3136
python -m jupyterlab.browser_check
37+
38+
- name: Package the extension
39+
run: |
40+
set -eux
3241
3342
pip install build
34-
python -m build --sdist
35-
cp dist/*.tar.gz myextension.tar.gz
43+
python -m build
3644
pip uninstall -y "jupyterlab_blockly" jupyterlab
37-
rm -rf myextension
3845
39-
- uses: actions/upload-artifact@v2
46+
- name: Upload extension packages
47+
uses: actions/upload-artifact@v3
4048
with:
41-
name: myextension-sdist
42-
path: myextension.tar.gz
49+
name: extension-artifacts
50+
path: dist/jupyterlab_blockly*
51+
if-no-files-found: error
4352

4453
test_isolated:
4554
needs: build
4655
runs-on: ubuntu-latest
4756

4857
steps:
49-
- name: Checkout
50-
uses: actions/checkout@v2
5158
- name: Install Python
52-
uses: actions/setup-python@v2
59+
uses: actions/setup-python@v4
5360
with:
54-
python-version: '3.8'
61+
python-version: '3.9'
5562
architecture: 'x64'
56-
- uses: actions/download-artifact@v2
63+
- uses: actions/download-artifact@v3
5764
with:
58-
name: myextension-sdist
65+
name: extension-artifacts
5966
- name: Install and Test
6067
run: |
6168
set -eux
6269
# Remove NodeJS, twice to take care of system and locally installed node versions.
6370
sudo rm -rf $(which node)
6471
sudo rm -rf $(which node)
65-
pip install myextension.tar.gz
66-
pip install jupyterlab
67-
jupyter labextension list 2>&1 | grep -ie "jupyterlab-blockly-extension.*OK"
72+
73+
pip install "jupyterlab>=4.0.0,<5" jupyterlab_blockly*.whl
74+
75+
76+
jupyter labextension list
77+
jupyter labextension list 2>&1 | grep -ie "jupyterlab-blockly.*OK"
6878
python -m jupyterlab.browser_check --no-browser-test
79+
80+
check_links:
81+
name: Check Links
82+
runs-on: ubuntu-latest
83+
timeout-minutes: 15
84+
steps:
85+
- uses: actions/checkout@v3
86+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
87+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1

.github/workflows/check-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ jobs:
2626
- name: Upload Distributions
2727
uses: actions/upload-artifact@v3
2828
with:
29-
name: jupyter-releaser-dist-${{ github.run_number }}
29+
name: jupyterlab_blockly-releaser-dist-${{ github.run_number }}
3030
path: |
3131
.jupyter_releaser_checkout/dist
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 }}"
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 }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ htmlcov/
5858
.coverage.*
5959
.cache
6060
nosetests.xml
61+
coverage/
6162
coverage.xml
6263
*.cover
6364
.hypothesis/
@@ -112,3 +113,6 @@ dmypy.json
112113

113114
# OSX files
114115
.DS_Store
116+
117+
# Yarn cache
118+
.yarn/

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
**/node_modules
33
**/style
44
**/package.json
5+
!/package.json
56
**/tsconfig.json
67
**/patches
78
**/scripts

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2022, quantstack
3+
Copyright (c) 2024, quantstack
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

0 commit comments

Comments
 (0)