Skip to content

Commit

Permalink
Upgrade to JupyterLab 4.0.0 beta (#296)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
fcollonval authored Apr 12, 2023
1 parent 357ede0 commit 94a1cf5
Show file tree
Hide file tree
Showing 180 changed files with 20,708 additions and 13,267 deletions.
16 changes: 8 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ module.exports = {
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:prettier/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.eslint.json',
sourceType: 'module',
sourceType: 'module'
},
plugins: ['@typescript-eslint'],
rules: {
Expand All @@ -19,9 +19,9 @@ module.exports = {
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: true,
},
},
match: true
}
}
],
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
'@typescript-eslint/no-explicit-any': 'off',
Expand All @@ -30,10 +30,10 @@ module.exports = {
'@typescript-eslint/quotes': [
'error',
'single',
{ avoidEscape: true, allowTemplateLiterals: false },
{ avoidEscape: true, allowTemplateLiterals: false }
],
curly: ['error', 'all'],
eqeqeq: 'error',
'prefer-arrow-callback': 'error',
},
'prefer-arrow-callback': 'error'
}
};
29 changes: 0 additions & 29 deletions .github/workflows/lint.yaml

This file was deleted.

138 changes: 104 additions & 34 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: '*'
branches: 'master'
pull_request:
branches: '*'

Expand All @@ -16,56 +16,126 @@ jobs:
- fasta
- geojson
- katex
- mathjax3
- mathjax2
- vega2
- vega3

steps:

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install node
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install dependencies
run: python -m pip install -U "jupyterlab>=4.0.0b0,<5"

- name: Lint the extension
run: |
set -eux
jlpm
jlpm run lint:check
- name: Build the extension
working-directory: packages/${{ matrix.extension }}-extension
run: |
set -eux
python -m pip install .[test]
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "@jupyterlab/${{ matrix.extension }}-extension.*OK"
python -m jupyterlab.browser_check
- name: Package the extension
working-directory: packages/${{ matrix.extension }}-extension
run: |
set -eux
pip install build
python -m build
pip uninstall -y "jupyterlab_${{ matrix.extension }}" jupyterlab
- name: Install Python
uses: actions/setup-python@v2
- name: Upload extension packages
uses: actions/upload-artifact@v3
with:
python-version: '3.9'
name: extension-artifacts
path: packages/${{ matrix.extension }}-extension/dist/jupyterlab_${{ matrix.extension }}*
if-no-files-found: error

- uses: actions/cache@v2
integration-tests:
name: Integration tests
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
extension:
- fasta
- geojson
- katex
- mathjax2
- vega3
jupyterlab:
- "3.6"
- 4.0.0b0
exclude:
- extension: katex
jupyterlab: "3.6"
- extension: mathjax2
jupyterlab: "3.6"

env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers

steps:
- name: Checkout
uses: actions/checkout@v3

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

- name: Download extension package
uses: actions/download-artifact@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-pip-
name: extension-artifacts

- name: Install JupyterLab
- name: Install the extension
run: |
python -m pip install jupyterlab
set -eux
python -m pip install "jupyterlab~=${{ matrix.jupyterlab }}" jupyterlab_${{ matrix.extension }}*.whl
- name: Get yarn (jlpm) cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(jlpm cache dir)"
- name: Install dependencies
working-directory: packages/${{ matrix.extension }}-extension/ui-tests
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: |
if [[ "${{ matrix.jupyterlab }}" == "3.6" ]]; then
sed -i s/5.0.0-beta.1/4.0.0/ package.json
fi
jlpm install
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- name: Set up browser cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
path: |
${{ github.workspace }}/pw-browsers
key: ${{ runner.os }}-${{ hashFiles('**/ui-tests/yarn.lock') }}

- name: Install the extensions
run: |
cd packages/${{ matrix.extension }}-extension
python -m pip install .
- name: Install browser
run: jlpm playwright install chromium
working-directory: packages/${{ matrix.extension }}-extension/ui-tests

- name: Check the extensions are installed
- name: Execute integration tests
working-directory: packages/${{ matrix.extension }}-extension/ui-tests
run: |
jupyter labextension list 2>&1 | grep -ie "@jupyterlab/${{ matrix.extension }}-extension.*OK"
jlpm playwright test
- name: Browser check
run: python -m jupyterlab.browser_check
- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@v3
with:
name: jupyterlab_${{ matrix.extension }}-${{ matrix.jupyterlab }}-playwright-tests
path: |
packages/${{ matrix.extension }}-extension/ui-tests/test-results
packages/${{ matrix.extension }}-extension/ui-tests/playwright-report
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,14 @@ dmypy.json

# OSX files
.DS_Store

# Yarn cache
.yarn/

# Integration tests
ui-tests/test-results/
ui-tests/playwright-report/

packages/*/*/_version.py
packages/*/*/labextension
.stylelintcache
7 changes: 5 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"singleQuote": true
}
"singleQuote": true,
"trailingComma": "none",
"arrowParens": "avoid",
"endOfLine": "auto"
}
12 changes: 12 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": [
"stylelint-config-recommended",
"stylelint-config-standard",
"stylelint-prettier/recommended"
],
"rules": {
"property-no-vendor-prefix": null,
"selector-no-vendor-prefix": null,
"value-no-vendor-prefix": null
}
}
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
enableImmutableInstalls: false

nodeLinker: node-modules
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017, Project Jupyter Contributors
Copyright (c) 2017-2023, Project Jupyter Contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
24 changes: 0 additions & 24 deletions MANIFEST.in

This file was deleted.

1 change: 0 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"lerna": "3.2.1",
"npmClient": "yarn",
"useWorkspaces": true,
"version": "independent"
Expand Down
27 changes: 0 additions & 27 deletions lint-staged.config.js

This file was deleted.

Loading

0 comments on commit 94a1cf5

Please sign in to comment.