Skip to content

Commit beade9f

Browse files
authored
Merge pull request #22 from yacchin1205/feature/notebook7
Notebook 7 support
2 parents 10be41b + 034d082 commit beade9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+30777
-5488
lines changed

.copier-answers.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: v4.2.4
3+
_src_path: https://github.com/jupyterlab/extension-template
4+
author_email: yazawa@yzwlab.net
5+
author_name: nii-cloud-operation
6+
data_format: string
7+
file_extension: ''
8+
has_binder: false
9+
has_settings: false
10+
kind: frontend
11+
labextension_name: lc_notebook_diff
12+
mimetype: ''
13+
mimetype_name: ''
14+
project_short_description: diff extension
15+
python_name: lc_notebook_diff
16+
repository: https://github.com/NII-cloud-operation/Jupyter-LC_notebook_diff
17+
test: true
18+
viewer_name: ''
19+

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Reference https://mybinder.readthedocs.io/en/latest/howto/gh-actions-badges.html
2+
name: Binder Badge
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
7+
permissions:
8+
pull-requests: write
9+
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 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+

.github/workflows/build.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: main
6+
pull_request:
7+
branches: '*'
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Base Setup
17+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
18+
19+
- name: Install dependencies
20+
run: python -m pip install -U 'jupyterlab>=4.0.0,<5'
21+
22+
- name: Build the extension
23+
run: |
24+
set -eux
25+
jlpm
26+
jlpm lint:check
27+
python -m pip install .
28+
29+
jupyter labextension list 2>&1 | grep -ie "lc_notebook_diff.*OK"
30+
python -m jupyterlab.browser_check
31+
32+
pip install build
33+
python -m build --sdist
34+
cp dist/*.tar.gz myextension.tar.gz
35+
pip uninstall -y "lc_notebook_diff" jupyterlab
36+
rm -rf myextension
37+
38+
- uses: actions/upload-artifact@v2
39+
with:
40+
name: myextension-sdist
41+
path: myextension.tar.gz
42+
43+
test_isolated:
44+
needs: build
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v2
50+
- name: Install Python
51+
uses: actions/setup-python@v2
52+
with:
53+
python-version: '3.9'
54+
architecture: 'x64'
55+
- uses: actions/download-artifact@v2
56+
with:
57+
name: myextension-sdist
58+
- name: Install and Test
59+
run: |
60+
set -eux
61+
# Remove NodeJS, twice to take care of system and locally installed node versions.
62+
sudo rm -rf $(which node)
63+
sudo rm -rf $(which node)
64+
pip install myextension.tar.gz
65+
pip install jupyterlab
66+
jupyter labextension list 2>&1 | grep -ie "lc_notebook_diff.*OK"
67+
python -m jupyterlab.browser_check --no-chrome-test
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
check_release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- 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@v3
26+
with:
27+
node-version: 18
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 .
54+
- name: Check Release
55+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
56+
with:
57+
token: ${{ secrets.GITHUB_TOKEN }}
58+
59+
- name: Upload Distributions
60+
uses: actions/upload-artifact@v2
61+
with:
62+
name: lc_notebook_diff-releaser-dist-${{ github.run_number }}
63+
path: .jupyter_releaser_checkout/dist

.github/workflows/release.yml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags: ['*']
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Install node
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: 18
18+
- name: Install Python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: '3.9'
22+
architecture: 'x64'
23+
24+
25+
- name: Setup pip cache
26+
uses: actions/cache@v2
27+
with:
28+
path: ~/.cache/pip
29+
key: pip-3.9-${{ hashFiles('package.json') }}
30+
restore-keys: |
31+
pip-3.9-
32+
pip-
33+
34+
- name: Get yarn cache directory path
35+
id: yarn-cache-dir-path
36+
run: echo "::set-output name=dir::$(yarn cache dir)"
37+
- name: Setup yarn cache
38+
uses: actions/cache@v2
39+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
40+
with:
41+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
42+
key: yarn-${{ hashFiles('**/yarn.lock') }}
43+
restore-keys: |
44+
yarn-
45+
46+
- name: Install dependencies
47+
run: python -m pip install -U 'jupyterlab>=4.0.0,<5'
48+
- name: Build the extension
49+
run: |
50+
set -eux
51+
jlpm
52+
jlpm run eslint:check
53+
cd ./components
54+
npm install
55+
npm run build
56+
cd ..
57+
cd ./nbextension
58+
npm install
59+
npm run build
60+
cd ..
61+
python -m pip install .
62+
63+
jupyter labextension list 2>&1 | grep -ie "lc_notebook_diff.*OK"
64+
python -m jupyterlab.browser_check
65+
66+
jlpm install
67+
cd ./ui-tests
68+
jlpm install
69+
jlpm playwright install
70+
jlpm playwright test
71+
cd ..
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+
npm pack
80+
mv lc_notebook_diff-*.tgz myextension-nodejs.tgz
81+
82+
- uses: actions/upload-artifact@v2
83+
with:
84+
name: myextension-sdist
85+
path: myextension.tar.gz
86+
87+
- uses: actions/upload-artifact@v2
88+
with:
89+
name: myextension-nodejs
90+
path: myextension-nodejs.tgz
91+
92+
draft_release:
93+
needs: build
94+
runs-on: ubuntu-latest
95+
96+
steps:
97+
- name: Checkout
98+
uses: actions/checkout@v2
99+
- uses: actions/download-artifact@v2
100+
with:
101+
name: myextension-sdist
102+
- uses: actions/download-artifact@v2
103+
with:
104+
name: myextension-nodejs
105+
- name: release
106+
uses: actions/create-release@v1
107+
id: create_release
108+
with:
109+
draft: true
110+
prerelease: false
111+
release_name: ${{ github.ref }}
112+
tag_name: ${{ github.ref }}
113+
body_path: CHANGELOG.md
114+
env:
115+
GITHUB_TOKEN: ${{ github.token }}
116+
- name: upload pip package
117+
uses: actions/upload-release-asset@v1
118+
env:
119+
GITHUB_TOKEN: ${{ github.token }}
120+
with:
121+
upload_url: ${{ steps.create_release.outputs.upload_url }}
122+
asset_path: myextension.tar.gz
123+
asset_name: lc_notebook_diff-${{ github.ref_name }}.tar.gz
124+
asset_content_type: application/gzip
125+
- name: upload nodejs package
126+
uses: actions/upload-release-asset@v1
127+
env:
128+
GITHUB_TOKEN: ${{ github.token }}
129+
with:
130+
upload_url: ${{ steps.create_release.outputs.upload_url }}
131+
asset_path: myextension-nodejs.tgz
132+
asset_name: lc_notebook_diff-${{ github.ref_name }}.tgz
133+
asset_content_type: application/gzip

0 commit comments

Comments
 (0)