Skip to content

Commit 94a1cf5

Browse files
authored
Upgrade to JupyterLab 4.0.0 beta (#296)
* Rough upgrade * Fix CI step order * Fix stylelint * Update year on licenses * Fix artifact path * Import mathjax2 * Create skeleton for integration tests * Add integration tests * Fix linter * Fix CI matrix * Test against 3.x * Fix Galata server configuration * Update mathjax2 snapshots * Fix integration tests * Fix cross compatibility * Propagate cross fix * Upgrade JupyterLab and Lumino * Yarn dedupe * Update sed * Test using DOM snapshot * Compare DOM snapshots * Lint the code * Fix tests for 3.6 * Try fixing playwright * Second attempt to fix the ui-tests for 3.6 * Ignore Katex for 3.6 Fix Vega3 selector
1 parent 357ede0 commit 94a1cf5

File tree

180 files changed

+20708
-13267
lines changed

Some content is hidden

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

180 files changed

+20708
-13267
lines changed

Diff for: .eslintrc.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ module.exports = {
33
'eslint:recommended',
44
'plugin:@typescript-eslint/eslint-recommended',
55
'plugin:@typescript-eslint/recommended',
6-
'plugin:prettier/recommended',
6+
'plugin:prettier/recommended'
77
],
88
parser: '@typescript-eslint/parser',
99
parserOptions: {
1010
project: 'tsconfig.eslint.json',
11-
sourceType: 'module',
11+
sourceType: 'module'
1212
},
1313
plugins: ['@typescript-eslint'],
1414
rules: {
@@ -19,9 +19,9 @@ module.exports = {
1919
format: ['PascalCase'],
2020
custom: {
2121
regex: '^I[A-Z]',
22-
match: true,
23-
},
24-
},
22+
match: true
23+
}
24+
}
2525
],
2626
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
2727
'@typescript-eslint/no-explicit-any': 'off',
@@ -30,10 +30,10 @@ module.exports = {
3030
'@typescript-eslint/quotes': [
3131
'error',
3232
'single',
33-
{ avoidEscape: true, allowTemplateLiterals: false },
33+
{ avoidEscape: true, allowTemplateLiterals: false }
3434
],
3535
curly: ['error', 'all'],
3636
eqeqeq: 'error',
37-
'prefer-arrow-callback': 'error',
38-
},
37+
'prefer-arrow-callback': 'error'
38+
}
3939
};

Diff for: .github/workflows/lint.yaml

-29
This file was deleted.

Diff for: .github/workflows/main.yml

+104-34
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

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

@@ -16,56 +16,126 @@ jobs:
1616
- fasta
1717
- geojson
1818
- katex
19-
- mathjax3
19+
- mathjax2
2020
- vega2
2121
- vega3
2222

2323
steps:
2424

2525
- name: Checkout
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v3
2727

28-
- name: Install node
29-
uses: actions/setup-node@v2
30-
with:
31-
node-version: '14.x'
28+
- name: Base Setup
29+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
30+
31+
- name: Install dependencies
32+
run: python -m pip install -U "jupyterlab>=4.0.0b0,<5"
33+
34+
- name: Lint the extension
35+
run: |
36+
set -eux
37+
jlpm
38+
jlpm run lint:check
39+
40+
- name: Build the extension
41+
working-directory: packages/${{ matrix.extension }}-extension
42+
run: |
43+
set -eux
44+
python -m pip install .[test]
45+
46+
jupyter labextension list
47+
jupyter labextension list 2>&1 | grep -ie "@jupyterlab/${{ matrix.extension }}-extension.*OK"
48+
python -m jupyterlab.browser_check
49+
50+
- name: Package the extension
51+
working-directory: packages/${{ matrix.extension }}-extension
52+
run: |
53+
set -eux
54+
55+
pip install build
56+
python -m build
57+
pip uninstall -y "jupyterlab_${{ matrix.extension }}" jupyterlab
3258
33-
- name: Install Python
34-
uses: actions/setup-python@v2
59+
- name: Upload extension packages
60+
uses: actions/upload-artifact@v3
3561
with:
36-
python-version: '3.9'
62+
name: extension-artifacts
63+
path: packages/${{ matrix.extension }}-extension/dist/jupyterlab_${{ matrix.extension }}*
64+
if-no-files-found: error
3765

38-
- uses: actions/cache@v2
66+
integration-tests:
67+
name: Integration tests
68+
needs: build
69+
runs-on: ubuntu-latest
70+
strategy:
71+
fail-fast: false
72+
matrix:
73+
extension:
74+
- fasta
75+
- geojson
76+
- katex
77+
- mathjax2
78+
- vega3
79+
jupyterlab:
80+
- "3.6"
81+
- 4.0.0b0
82+
exclude:
83+
- extension: katex
84+
jupyterlab: "3.6"
85+
- extension: mathjax2
86+
jupyterlab: "3.6"
87+
88+
env:
89+
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
90+
91+
steps:
92+
- name: Checkout
93+
uses: actions/checkout@v3
94+
95+
- name: Base Setup
96+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
97+
98+
- name: Download extension package
99+
uses: actions/download-artifact@v3
39100
with:
40-
path: ~/.cache/pip
41-
key: ${{ runner.os }}-pip-${{ hashFiles('**/package.json') }}
42-
restore-keys: |
43-
${{ runner.os }}-pip-
101+
name: extension-artifacts
44102

45-
- name: Install JupyterLab
103+
- name: Install the extension
46104
run: |
47-
python -m pip install jupyterlab
105+
set -eux
106+
python -m pip install "jupyterlab~=${{ matrix.jupyterlab }}" jupyterlab_${{ matrix.extension }}*.whl
48107
49-
- name: Get yarn (jlpm) cache directory path
50-
id: yarn-cache-dir-path
51-
run: echo "::set-output name=dir::$(jlpm cache dir)"
108+
- name: Install dependencies
109+
working-directory: packages/${{ matrix.extension }}-extension/ui-tests
110+
env:
111+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
112+
run: |
113+
if [[ "${{ matrix.jupyterlab }}" == "3.6" ]]; then
114+
sed -i s/5.0.0-beta.1/4.0.0/ package.json
115+
fi
116+
jlpm install
52117
53-
- uses: actions/cache@v2
54-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
118+
- name: Set up browser cache
119+
uses: actions/cache@v3
55120
with:
56-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
57-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
58-
restore-keys: |
59-
${{ runner.os }}-yarn-
121+
path: |
122+
${{ github.workspace }}/pw-browsers
123+
key: ${{ runner.os }}-${{ hashFiles('**/ui-tests/yarn.lock') }}
60124

61-
- name: Install the extensions
62-
run: |
63-
cd packages/${{ matrix.extension }}-extension
64-
python -m pip install .
125+
- name: Install browser
126+
run: jlpm playwright install chromium
127+
working-directory: packages/${{ matrix.extension }}-extension/ui-tests
65128

66-
- name: Check the extensions are installed
129+
- name: Execute integration tests
130+
working-directory: packages/${{ matrix.extension }}-extension/ui-tests
67131
run: |
68-
jupyter labextension list 2>&1 | grep -ie "@jupyterlab/${{ matrix.extension }}-extension.*OK"
132+
jlpm playwright test
69133
70-
- name: Browser check
71-
run: python -m jupyterlab.browser_check
134+
- name: Upload Playwright Test report
135+
if: always()
136+
uses: actions/upload-artifact@v3
137+
with:
138+
name: jupyterlab_${{ matrix.extension }}-${{ matrix.jupyterlab }}-playwright-tests
139+
path: |
140+
packages/${{ matrix.extension }}-extension/ui-tests/test-results
141+
packages/${{ matrix.extension }}-extension/ui-tests/playwright-report

Diff for: .gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,14 @@ dmypy.json
111111

112112
# OSX files
113113
.DS_Store
114+
115+
# Yarn cache
116+
.yarn/
117+
118+
# Integration tests
119+
ui-tests/test-results/
120+
ui-tests/playwright-report/
121+
122+
packages/*/*/_version.py
123+
packages/*/*/labextension
124+
.stylelintcache

Diff for: .prettierrc

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"singleQuote": true
3-
}
2+
"singleQuote": true,
3+
"trailingComma": "none",
4+
"arrowParens": "avoid",
5+
"endOfLine": "auto"
6+
}

Diff for: .stylelintrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": [
3+
"stylelint-config-recommended",
4+
"stylelint-config-standard",
5+
"stylelint-prettier/recommended"
6+
],
7+
"rules": {
8+
"property-no-vendor-prefix": null,
9+
"selector-no-vendor-prefix": null,
10+
"value-no-vendor-prefix": null
11+
}
12+
}

Diff for: .yarnrc

-1
This file was deleted.

Diff for: .yarnrc.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
enableImmutableInstalls: false
2+
3+
nodeLinker: node-modules

Diff for: LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2017, Project Jupyter Contributors
1+
Copyright (c) 2017-2023, Project Jupyter Contributors
22
All rights reserved.
33

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

Diff for: MANIFEST.in

-24
This file was deleted.

Diff for: lerna.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"lerna": "3.2.1",
32
"npmClient": "yarn",
43
"useWorkspaces": true,
54
"version": "independent"

Diff for: lint-staged.config.js

-27
This file was deleted.

0 commit comments

Comments
 (0)