Skip to content

Commit 3297599

Browse files
authored
Build using JupyterLab 4 (#543)
* Build using JupyterLab 4 * Exclude figure captions from image comparison tests
1 parent c218e07 commit 3297599

32 files changed

+15301
-10183
lines changed

.binder/environment.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ channels:
44
dependencies:
55
- yarn
66
- numpy
7-
- jupyterlab>=3,<4
7+
- jupyterlab~=4.0
88
- retrolab
99
- matplotlib-base>=2.2.2
10-
- jupyter-packaging=0.7

.github/workflows/main.yml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,15 @@ jobs:
9292
9393
- name: Test installation files
9494
run: |
95+
ls -l $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib
9596
test -d $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib
9697
test -f $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib/extension.js
9798
test -f $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib/index.js
99+
ls -l $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib
98100
test -d $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib
99101
test -f $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib/package.json
100102
test -d $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib/static
101103
102-
- name: Validate the nbextension
103-
run: jupyter nbextension list 2>&1 | grep "jupyter-matplotlib/extension"
104-
105104
- name: Validate the labextension
106105
run: jupyter labextension list 2>&1 | grep jupyter-matplotlib
107106

@@ -115,21 +114,9 @@ jobs:
115114
jlpm playwright install chromium
116115
working-directory: ui-tests
117116

118-
- name: Launch JupyterLab
119-
if: matrix.os == 'ubuntu'
120-
run: jlpm start:detached
121-
working-directory: ui-tests
122-
123-
- name: Wait for JupyterLab
124-
if: matrix.os == 'ubuntu'
125-
uses: ifaxity/wait-on-action@v1
126-
with:
127-
resource: http-get://localhost:8888/api
128-
timeout: 20000
129-
130117
- name: Run UI Tests
131118
if: matrix.os == 'ubuntu'
132-
run: jlpm test
119+
run: jlpm playwright test
133120
working-directory: ui-tests
134121

135122
- name: Upload UI Test artifacts

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
compressionLevel: mixed
2+
enableGlobalCache: false
3+
nodeLinker: node-modules

dev-environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ channels:
33
- conda-forge
44
dependencies:
55
- pip
6-
- yarn
7-
- jupyterlab=3
6+
- yarn~=3.0
7+
- jupyterlab~=4.0
88
- ipywidgets>=7.6
99
- pillow
1010
- numpy

package.json

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,33 +53,43 @@
5353
"devDependencies": {
5454
"@babel/core": "^7.5.0",
5555
"@babel/preset-env": "^7.5.0",
56-
"@jupyterlab/builder": "^3.0.0",
56+
"@jupyterlab/builder": "^4.0.0",
57+
"@jupyterlab/testutils": "^4.0.0",
5758
"@phosphor/application": "^1.6.0",
5859
"@phosphor/widgets": "^1.6.0",
59-
"@types/jest": "^26.0.0",
60+
"@types/jest": "^29.2.0",
61+
"@types/json-schema": "^7.0.11",
6062
"@types/lodash": "^4.14.202",
63+
"@types/react": "^18.0.26",
64+
"@types/react-addons-linked-state-mixin": "^0.14.22",
6165
"@types/webpack-env": "^1.13.6",
62-
"@typescript-eslint/eslint-plugin": "^3.6.0",
63-
"@typescript-eslint/parser": "^3.6.0",
66+
"@typescript-eslint/eslint-plugin": "^6.1.0",
67+
"@typescript-eslint/parser": "^6.1.0",
6468
"acorn": "^7.2.0",
65-
"css-loader": "^3.2.0",
66-
"eslint": "^7.4.0",
67-
"eslint-config-prettier": "^6.11.0",
68-
"eslint-plugin-prettier": "^3.1.4",
69+
"css-loader": "^6.7.1",
70+
"eslint": "^8.36.0",
71+
"eslint-config-prettier": "^8.8.0",
72+
"eslint-plugin-prettier": "^5.0.0",
6973
"fs-extra": "^7.0.0",
7074
"identity-obj-proxy": "^3.0.0",
71-
"jest": "^26.0.0",
75+
"jest": "^29.2.0",
7276
"mkdirp": "^0.5.1",
73-
"npm-run-all": "^4.1.3",
74-
"prettier": "^2.0.5",
75-
"rimraf": "^2.6.2",
76-
"source-map-loader": "^1.1.3",
77-
"style-loader": "^1.0.0",
77+
"npm-run-all": "^4.1.5",
78+
"prettier": "^3.0.0",
79+
"rimraf": "^5.0.1",
80+
"source-map-loader": "^1.0.2",
81+
"style-loader": "^3.3.1",
82+
"stylelint": "^15.10.1",
83+
"stylelint-config-recommended": "^13.0.0",
84+
"stylelint-config-standard": "^34.0.0",
85+
"stylelint-csstree-validator": "^3.0.0",
86+
"stylelint-prettier": "^4.0.0",
7887
"ts-jest": "^26.0.0",
7988
"ts-loader": "^8.0.0",
80-
"typescript": "^4.0.0",
89+
"typescript": "~5.0.2",
8190
"webpack": "^5.61.0",
82-
"webpack-cli": "^4.0.0"
91+
"webpack-cli": "^4.0.0",
92+
"yjs": "^13.5.40"
8393
},
8494
"dependencies": {
8595
"@jupyter-widgets/base": "^2 || ^3 || ^4 || ^5 || ^6",

pyproject.toml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[build-system]
22
requires = [
33
"hatchling",
4-
"jupyterlab>=3.0.0,==3.*",
4+
"jupyterlab==4.*",
5+
"hatch-nodejs-version>=0.3.2",
56
]
67
build-backend = "hatchling.build"
78

@@ -22,8 +23,17 @@ keywords = [
2223
classifiers = [
2324
"Development Status :: 4 - Beta",
2425
"Framework :: IPython",
26+
"Framework :: Jupyter",
27+
"Framework :: Jupyter :: JupyterLab",
28+
"Framework :: Jupyter :: JupyterLab :: 3",
29+
"Framework :: Jupyter :: JupyterLab :: 4",
30+
"Framework :: Jupyter :: JupyterLab :: Extensions",
31+
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
2532
"Intended Audience :: Developers",
2633
"Intended Audience :: Science/Research",
34+
"License :: OSI Approved :: BSD License",
35+
"Programming Language :: Python",
36+
"Programming Language :: Python :: 3",
2737
"Programming Language :: Python :: 3.9",
2838
"Programming Language :: Python :: 3.10",
2939
"Programming Language :: Python :: 3.11",
@@ -39,6 +49,7 @@ dependencies = [
3949
"pillow",
4050
"traitlets<6",
4151
]
52+
requires-python = ">=3.9"
4253
version = "0.9.3"
4354

4455
[project.optional-dependencies]
@@ -66,7 +77,7 @@ artifacts = [
6677
[tool.hatch.build.targets.wheel.shared-data]
6778
"ipympl/nbextension" = "share/jupyter/nbextensions/jupyter-matplotlib"
6879
"ipympl/labextension" = "share/jupyter/labextensions/jupyter-matplotlib"
69-
"./jupyter-matplotlib.json" = "etc/jupyter/nbconfig/notebook.d/jupyter-matplotlib.json"
80+
"jupyter-matplotlib.json" = "etc/jupyter/nbconfig/notebook.d/jupyter-matplotlib.json"
7081

7182
[tool.hatch.build.targets.sdist]
7283
exclude = [

ui-tests/jupyter_server_config.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
from tempfile import mkdtemp
1+
"""Server configuration for integration tests.
22
3-
c.ServerApp.port = 8888 # noqa
4-
c.ServerApp.token = "" # noqa
5-
c.ServerApp.password = "" # noqa
6-
c.ServerApp.disable_check_xsrf = True # noqa
7-
c.ServerApp.open_browser = False # noqa
8-
c.ServerApp.root_dir = mkdtemp(prefix='galata-test-') # noqa
3+
!! Never use this configuration in production because it
4+
opens the server to the world and provide access to JupyterLab
5+
JavaScript objects through the global window variable.
6+
"""
7+
from jupyterlab.galata import configure_jupyter_server
98

10-
c.LabApp.expose_app_in_browser = True # noqa
9+
configure_jupyter_server(c) # noqa F821
10+
11+
# Uncomment to set server log level to debug level
12+
# c.ServerApp.log_level = "DEBUG"

ui-tests/package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@
55
"private": true,
66
"scripts": {
77
"start": "jupyter lab --config ./jupyter_server_config.py",
8-
"start:detached": "jlpm start&",
9-
"test": "playwright test",
10-
"test:debug": "PWDEBUG=1 playwright test",
11-
"test:report": "http-server ./playwright-report -a localhost -o",
12-
"test:update": "playwright test --update-snapshots"
8+
"test": "jlpm playwright test",
9+
"test:debug": "PWDEBUG=1 jlpm playwright test",
10+
"test:update": "jlpm playwright test --update-snapshots"
1311
},
1412
"author": "ipympl",
1513
"license": "Apache-2.0",
16-
"dependencies": {
17-
"@jupyterlab/galata": "~4.5.0",
18-
"@playwright/test": "^1.16.2",
14+
"devDependencies": {
15+
"@jupyterlab/galata": "^5.0.5",
16+
"@playwright/test": "^1.37.0",
1917
"klaw-sync": "^6.0.0",
2018
"rimraf": "^3.0.2"
2119
}

ui-tests/playwright.config.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
/**
2+
* Configuration for Playwright using default from @jupyterlab/galata
3+
*/
14
const baseConfig = require('@jupyterlab/galata/lib/playwright-config');
25

36
module.exports = {
47
...baseConfig,
5-
timeout: 600000,
6-
retries: 1,
8+
webServer: {
9+
command: 'jlpm start',
10+
url: 'http://localhost:8888/lab',
11+
timeout: 120 * 1000,
12+
reuseExistingServer: !process.env.CI
13+
}
714
};
Loading

0 commit comments

Comments
 (0)