Skip to content

Commit 528d65a

Browse files
jtpiohorw
andauthored
Update to JupyterLite 0.6.0 and the new template (#10)
* Update to JuptyerLite 0.6.0 and the new template Co-Authored-By: igor udot <[email protected]> * lint * skip browser check for now * fix version * deploy workflow * Require lite 0.6.0 in the readme --------- Co-authored-by: igor udot <[email protected]>
1 parent 450714f commit 528d65a

30 files changed

+5563
-5685
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: JupyterLite Contributors
6+
has_binder: false
7+
has_settings: false
8+
kind: frontend
9+
labextension_name: '@jupyterlite/echo-kernel'
10+
project_short_description: Echo kernel for JupyterLite
11+
python_name: jupyterlite_echo_kernel
12+
repository: https://github.com/jupyterlite/echo-kernel
13+
test: false
14+

.eslintignore

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

.eslintrc.js

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

.github/workflows/build.yml

Lines changed: 89 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,95 +6,132 @@ 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
15-
- name: Install node
16-
uses: actions/setup-node@v1
17-
with:
18-
node-version: '14.x'
19-
- name: Install Python
20-
uses: actions/setup-python@v2
21-
with:
22-
python-version: '3.8'
23-
architecture: 'x64'
24-
19+
uses: actions/checkout@v4
2520

26-
- name: Setup pip cache
27-
uses: actions/cache@v2
28-
with:
29-
path: ~/.cache/pip
30-
key: pip-3.8-${{ hashFiles('package.json') }}
31-
restore-keys: |
32-
pip-3.8-
33-
pip-
34-
35-
- name: Get yarn cache directory path
36-
id: yarn-cache-dir-path
37-
run: echo "::set-output name=dir::$(yarn cache dir)"
38-
- name: Setup yarn cache
39-
uses: actions/cache@v2
40-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
41-
with:
42-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
43-
key: yarn-${{ hashFiles('**/yarn.lock') }}
44-
restore-keys: |
45-
yarn-
21+
- name: Base Setup
22+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
4623

4724
- name: Install dependencies
48-
run: python -m pip install -U jupyterlab~=3.1 check-manifest
49-
- name: Build the extension
25+
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
26+
27+
- name: Lint the extension
5028
run: |
5129
set -eux
5230
jlpm
53-
jlpm run eslint:check
54-
python -m pip install .
31+
jlpm run lint:check
32+
33+
- name: Build the extension
34+
run: |
35+
set -eux
36+
python -m pip install .[test]
5537
38+
jupyter labextension list
5639
jupyter labextension list 2>&1 | grep -ie "@jupyterlite/echo-kernel.*OK"
5740
5841
# TODO: add JupyterLite browser check
5942
# python -m jupyterlab.browser_check
6043
61-
check-manifest -v
44+
- name: Package the extension
45+
run: |
46+
set -eux
6247
6348
pip install build
64-
python -m build --sdist
65-
cp dist/*.tar.gz myextension.tar.gz
66-
pip uninstall -y myextension jupyterlab
67-
rm -rf myextension
49+
python -m build
50+
pip uninstall -y "jupyterlite_echo_kernel" jupyterlab
6851
69-
- uses: actions/upload-artifact@v2
52+
- name: Upload extension packages
53+
uses: actions/upload-artifact@v4
7054
with:
71-
name: myextension-sdist
72-
path: myextension.tar.gz
55+
name: extension-artifacts
56+
path: dist/jupyterlite_echo_kernel*
57+
if-no-files-found: error
58+
59+
build_lite:
60+
runs-on: ubuntu-latest
61+
needs: build
62+
steps:
63+
- name: Checkout
64+
uses: actions/checkout@v4
65+
- name: Setup Python
66+
uses: actions/setup-python@v5
67+
with:
68+
python-version: '3.11'
69+
- uses: actions/download-artifact@v4
70+
with:
71+
name: extension-artifacts
72+
- name: Install the dependencies
73+
run: |
74+
python -m pip install --pre jupyterlite-core jupyterlite_echo_kernel*.whl
75+
- name: Build the JupyterLite site
76+
run: |
77+
jupyter lite build --output-dir dist
78+
- name: Upload artifact
79+
uses: actions/upload-pages-artifact@v3
80+
with:
81+
path: ./dist
82+
83+
deploy_lite:
84+
needs: build_lite
85+
if: github.ref == 'refs/heads/main'
86+
permissions:
87+
pages: write
88+
id-token: write
89+
90+
environment:
91+
name: github-pages
92+
url: ${{ steps.deployment.outputs.page_url }}
93+
94+
runs-on: ubuntu-latest
95+
steps:
96+
- name: Deploy to GitHub Pages
97+
id: deployment
98+
uses: actions/deploy-pages@v4
7399

74100
test_isolated:
75101
needs: build
76102
runs-on: ubuntu-latest
77103

78104
steps:
79-
- name: Checkout
80-
uses: actions/checkout@v2
81105
- name: Install Python
82-
uses: actions/setup-python@v2
106+
uses: actions/setup-python@v5
83107
with:
84-
python-version: '3.8'
108+
python-version: '3.9'
85109
architecture: 'x64'
86-
- uses: actions/download-artifact@v2
110+
- uses: actions/download-artifact@v4
87111
with:
88-
name: myextension-sdist
112+
name: extension-artifacts
89113
- name: Install and Test
90114
run: |
91115
set -eux
92116
# Remove NodeJS, twice to take care of system and locally installed node versions.
93117
sudo rm -rf $(which node)
94118
sudo rm -rf $(which node)
95-
pip install myextension.tar.gz
96-
pip install jupyterlab
119+
120+
pip install "jupyterlab>=4.0.0,<5" jupyterlite_echo_kernel*.whl
121+
122+
123+
jupyter labextension list
97124
jupyter labextension list 2>&1 | grep -ie "@jupyterlite/echo-kernel.*OK"
98125
99126
# TODO: add JupyterLite browser check
100-
# python -m jupyterlab.browser_check --no-chrome-test
127+
# python -m jupyterlab.browser_check --no-browser-test
128+
129+
130+
check_links:
131+
name: Check Links
132+
runs-on: ubuntu-latest
133+
timeout-minutes: 15
134+
steps:
135+
- uses: actions/checkout@v4
136+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
137+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1

.github/workflows/check-release.yml

Lines changed: 16 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +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-
- name: Get pip cache dir
29-
id: pip-cache
30-
run: |
31-
echo "::set-output name=dir::$(pip cache dir)"
32-
- name: Cache pip
33-
uses: actions/cache@v1
34-
with:
35-
path: ${{ steps.pip-cache.outputs.dir }}
36-
key: ${{ runner.os }}-pip-${{ hashFiles('package.json') }}
37-
restore-keys: |
38-
${{ runner.os }}-pip-
39-
- name: Cache checked links
40-
uses: actions/cache@v2
41-
with:
42-
path: ~/.cache/pytest-link-check
43-
key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/.md') }}-md-links
44-
restore-keys: |
45-
${{ runner.os }}-linkcheck-
46-
- name: Upgrade packaging dependencies
47-
run: |
48-
pip install --upgrade pip setuptools wheel jupyter-packaging~=0.10 --user
49-
- name: Install Dependencies
50-
run: |
51-
pip install .
17+
uses: actions/checkout@v4
18+
- name: Base Setup
19+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
5220
- name: Check Release
53-
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
21+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
5422
with:
23+
5524
token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Upload Distributions
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: jupyterlite_echo_kernel-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)