Skip to content

Commit 1723f47

Browse files
authored
Upgrade for JupyterLab 4 and notebook 7 (#118)
* Migrate to copier * Fix setting & add integration tests * Fix linter * Upgrade galata * Fix integration tests * Clean up workflows * Configure test for notebook 7 * Update README * Fix server setup for JupyterLab 3 * Lint files * Fix tests * Skip one test for 3.6
1 parent b394deb commit 1723f47

Some content is hidden

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

44 files changed

+16191
-4536
lines changed

.copier-answers.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: v4.1.0
3+
_src_path: https://github.com/jupyterlab/extension-template
4+
author_email: 'Hadrien Mary'
5+
author_name: '[email protected]'
6+
data_format: string
7+
file_extension: ''
8+
has_binder: true
9+
has_settings: true
10+
kind: server
11+
labextension_name: '@hadim/jupyter-archive'
12+
mimetype: ''
13+
mimetype_name: ''
14+
project_short_description: A Jupyterlab extension to make, download and extract archive
15+
files.
16+
python_name: jupyter_archive
17+
repository: https://github.com/jupyterlab-contrib/jupyter-archive.git
18+
test: true
19+
viewer_name: ''
20+

.eslintignore

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

.eslintrc.js

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

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

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

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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: 193 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,214 @@ name: Build
22

33
on:
44
push:
5-
branches: master
5+
branches: main
66
pull_request:
77
branches: '*'
88

99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12+
1213
steps:
1314
- name: Checkout
14-
uses: actions/checkout@v2
15-
- name: Install node
16-
uses: actions/setup-node@v1
15+
uses: actions/checkout@v3
16+
17+
- name: Base Setup
18+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
19+
20+
- name: Install dependencies
21+
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
22+
23+
- name: Lint the extension
24+
run: |
25+
set -eux
26+
jlpm
27+
jlpm run lint:check
28+
29+
- name: Build the extension
30+
run: |
31+
set -eux
32+
python -m pip install .[test]
33+
34+
pytest -vv -r ap --cov jupyter_archive
35+
jupyter server extension list
36+
jupyter server extension list 2>&1 | grep -ie "jupyter_archive.*OK"
37+
38+
jupyter labextension list
39+
jupyter labextension list 2>&1 | grep -ie "@hadim/jupyter-archive.*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 "jupyter-archive" jupyterlab
49+
50+
- name: Upload extension packages
51+
uses: actions/upload-artifact@v3
1752
with:
18-
node-version: '14.x'
53+
name: extension-artifacts
54+
path: dist/jupyter_archive*
55+
if-no-files-found: error
56+
57+
test_isolated:
58+
needs: build
59+
runs-on: ubuntu-latest
60+
61+
steps:
1962
- name: Install Python
20-
uses: actions/setup-python@v2
63+
uses: actions/setup-python@v4
2164
with:
2265
python-version: '3.9'
2366
architecture: 'x64'
24-
- name: Install dependencies
25-
run: python -m pip install jupyterlab pytest "pytest-jupyter[server]>=0.6.0"
26-
- name: Build the extension
67+
- uses: actions/download-artifact@v3
68+
with:
69+
name: extension-artifacts
70+
- name: Install and Test
2771
run: |
28-
jlpm
29-
jlpm run eslint:check
30-
python -m pip install .
31-
pytest jupyter_archive
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" jupyter_archive*.whl
78+
3279
80+
jupyter server extension list
3381
jupyter server extension list 2>&1 | grep -ie "jupyter_archive.*OK"
3482
83+
jupyter labextension list
3584
jupyter labextension list 2>&1 | grep -ie "@hadim/jupyter-archive.*OK"
36-
python -m jupyterlab.browser_check
85+
python -m jupyterlab.browser_check --no-browser-test
86+
87+
integration-tests-lab:
88+
name: Integration tests for JupyterLab
89+
strategy:
90+
fail-fast: false
91+
matrix:
92+
jupyterlab: ['3.6', '4.0']
93+
needs: build
94+
runs-on: ubuntu-latest
95+
96+
env:
97+
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
98+
99+
steps:
100+
- name: Checkout
101+
uses: actions/checkout@v3
102+
103+
- name: Base Setup
104+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
105+
106+
- name: Download extension package
107+
uses: actions/download-artifact@v3
108+
with:
109+
name: extension-artifacts
110+
111+
- name: Install the extension
112+
run: |
113+
set -eux
114+
python -m pip install "jupyterlab~=${{ matrix.jupyterlab }}" jupyter_archive*.whl
115+
116+
- name: Install dependencies
117+
working-directory: ui-tests
118+
env:
119+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
120+
run: |
121+
if [[ "${{ matrix.jupyterlab }}" == "3.6" ]]; then
122+
jlpm add -D "@jupyterlab/galata@^4.0.0"
123+
fi
124+
jlpm install
125+
126+
- name: Set up browser cache
127+
uses: actions/cache@v3
128+
with:
129+
path: |
130+
${{ github.workspace }}/pw-browsers
131+
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
132+
133+
- name: Install browser
134+
run: jlpm playwright install chromium
135+
working-directory: ui-tests
136+
137+
- name: Execute integration tests
138+
working-directory: ui-tests
139+
run: |
140+
jlpm playwright test --output test-results-${{ matrix.jupyterlab }}
141+
142+
- name: Upload Playwright Test report
143+
if: always()
144+
uses: actions/upload-artifact@v3
145+
with:
146+
name: jupyter-archive-playwright-tests
147+
path: |
148+
ui-tests/test-results*
149+
ui-tests/playwright-report
150+
151+
integration-tests-nb:
152+
name: Integration tests for Notebook
153+
needs: build
154+
runs-on: ubuntu-latest
155+
156+
env:
157+
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
158+
159+
steps:
160+
- name: Checkout
161+
uses: actions/checkout@v3
162+
163+
- name: Base Setup
164+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
165+
166+
- name: Download extension package
167+
uses: actions/download-artifact@v3
168+
with:
169+
name: extension-artifacts
170+
171+
- name: Install the extension
172+
run: |
173+
set -eux
174+
python -m pip install "notebook~=7.0" jupyter_archive*.whl
175+
176+
- name: Install dependencies
177+
working-directory: ui-tests
178+
env:
179+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
180+
run: |
181+
jlpm install
182+
183+
- name: Set up browser cache
184+
uses: actions/cache@v3
185+
with:
186+
path: |
187+
${{ github.workspace }}/pw-browsers
188+
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
189+
190+
- name: Install browser
191+
run: jlpm playwright install chromium
192+
working-directory: ui-tests
193+
194+
- name: Execute integration tests
195+
working-directory: ui-tests
196+
run: |
197+
jlpm playwright test -c playwright-notebook.config.js
198+
199+
- name: Upload Playwright Test report
200+
if: always()
201+
uses: actions/upload-artifact@v3
202+
with:
203+
name: notebook-tour-playwright-tests
204+
path: |
205+
ui-tests/test-results
206+
ui-tests/playwright-report
207+
208+
check_links:
209+
name: Check Links
210+
runs-on: ubuntu-latest
211+
timeout-minutes: 15
212+
steps:
213+
- uses: actions/checkout@v3
214+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
215+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches: ["main"]
5+
pull_request:
6+
branches: ["*"]
7+
8+
jobs:
9+
check_release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Base Setup
15+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
16+
- name: Install Dependencies
17+
run: |
18+
pip install -e .
19+
- name: Check Release
20+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
21+
with:
22+
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Upload Distributions
26+
uses: actions/upload-artifact@v3
27+
with:
28+
name: jupyter-archive-releaser-dist-${{ github.run_number }}
29+
path: .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

0 commit comments

Comments
 (0)