Skip to content

Commit 9fb9313

Browse files
diocasetejedor
authored andcommitted
SparkMonitor: update to Lab 4
Mix of running Jupyter migration tool while keeping some of the old configurations (done in order to be quicker)
1 parent a35015e commit 9fb9313

13 files changed

Lines changed: 8974 additions & 9775 deletions

File tree

.github/workflows/checks.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
- uses: actions/checkout@v2
1919

2020
- name: Setup Node.js environment
21-
uses: actions/setup-node@v2.4.0
21+
uses: actions/setup-node@v4
2222
with:
23-
node-version: 12.x
23+
node-version: 20.x
2424
cache: yarn
2525
cache-dependency-path: yarn.lock
2626

@@ -30,10 +30,10 @@ jobs:
3030
python-version: 3.x
3131

3232
- name: Install Jupyterlab
33-
run: pip install jupyterlab==3
33+
run: pip install jupyterlab==4
3434

3535
- name: Install JS dependencies
36-
run: yarn install --immutable
36+
run: jlpm install --immutable
3737

3838
- name: "JavaScript Checks"
39-
run: yarn run check:all
39+
run: jlpm check:all

.github/workflows/publish.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ jobs:
2121
python-version: '3.x'
2222

2323
- name: Install node
24-
uses: actions/setup-node@v1
24+
uses: actions/setup-node@v4
2525
with:
26-
always-auth: true
27-
node-version: '12.x'
28-
registry-url: https://registry.npmjs.org
26+
node-version: '20.x'
2927

3028
- name: Set up JDK 1.8
3129
uses: actions/setup-java@v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ venv
1818
.metals
1919
*.tsbuildinfo
2020
scalalistener/.bsp
21+
.yarn

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
**/node_modules
3+
**/lib
4+
**/package.json
5+
!/package.json
6+
sparkmonitor

.yarnrc.yml

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ SparkMonitor is an extension for Jupyter Notebook & Lab that enables the live mo
2121

2222
## Requirements
2323

24-
- Jupyter Lab 3 OR Jupyter Notebook 4.4.0 or higher
24+
- Jupyter Lab 4 OR Jupyter Notebook 4.4.0 or higher
2525
- pyspark 2 or 3
2626

2727
## Features

package.json

Lines changed: 119 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,121 @@
11
{
2-
"name": "sparkmonitor",
3-
"version": "2.1.1",
4-
"description": "Jupyter Notebook & Lab extension to monitor Apache Spark jobs from a notebook",
5-
"repository": {
6-
"type": "git",
7-
"url": "git+https://github.com/swan-cern/sparkmonitor.git"
8-
},
9-
"keywords": [
10-
"jupyter",
11-
"jupyterlab",
12-
"jupyterlab-extension",
13-
"Spark",
14-
"sparkmonitor"
15-
],
16-
"main": "lib/lab-extension/index.js",
17-
"author": {
18-
"name": "Krishnan R",
19-
"email": "krishnanr1997@gmail.com"
20-
},
21-
"maintainers": [
22-
{
23-
"name": "SWAN Team",
24-
"email": "swan-admins@cern.ch"
25-
}
26-
],
27-
"license": "Apache-2.0",
28-
"bugs": {
29-
"url": "https://github.com/swan-cern/sparkmonitor/issues"
30-
},
31-
"homepage": "https://github.com/swan-cern/sparkmonitor#readme",
32-
"devDependencies": {
33-
"@babel/cli": "^7.14.8",
34-
"@babel/core": "^7.14.8",
35-
"@babel/preset-env": "^7.14.9",
36-
"@babel/preset-react": "^7.14.5",
37-
"@babel/preset-typescript": "^7.14.5",
38-
"@jupyterlab/builder": "^3.0.0",
39-
"@types/node": "^16.4.10",
40-
"@types/plotly.js-basic-dist": "^1.54.0",
41-
"@types/react-dom": "^17.0.9",
42-
"@types/react-plotly.js": "^2.5.0",
43-
"@types/react-timeago": "^4.1.3",
44-
"@types/webpack": "^5.28.0",
45-
"@typescript-eslint/eslint-plugin": "^4.28.3",
46-
"@typescript-eslint/parser": "^4.28.3",
47-
"babel-eslint": "^10.1.0",
48-
"babel-loader": "^8.2.2",
49-
"css-loader": "^0.28.4",
50-
"eslint": "^7.14.0",
51-
"eslint-config-airbnb": "^18.1.0",
52-
"eslint-config-prettier": "^6.15.0",
53-
"eslint-plugin-import": "^2.20.2",
54-
"eslint-plugin-jsx-a11y": "^6.2.3",
55-
"eslint-plugin-prettier": "^3.1.4",
56-
"eslint-plugin-react": "^7.19.0",
57-
"eslint-plugin-react-hooks": "^4.2.0",
58-
"file-loader": "^6.0.0",
59-
"html-loader": "^0.4.5",
60-
"ify-loader": "^1.0.4",
61-
"npm-run-all": "^4.1.5",
62-
"prettier": "^2.1.1",
63-
"rimraf": "^3.0.2",
64-
"style-loader": "^0.18.2",
65-
"typescript": "^4.3.5",
66-
"url-loader": "^0.5.9",
67-
"webpack-cli": "^3.3.10"
68-
},
69-
"scripts": {
70-
"build:prod": "jlpm run build:lib && jlpm run build:labextension && jlpm run build:nbextension && jlpm run build:scalalistener",
71-
"build": "jlpm run build:lib && jlpm run build:labextension",
72-
"build:lib": "tsc -p tsconfig.lab.json",
73-
"build:labextension": "jupyter labextension build .",
74-
"build:labextension:dev": "jupyter labextension build --development True .",
75-
"build:scalalistener": "cd scalalistener && sbt +assembly",
76-
"clean": "rimraf lib jupyterlab_sparkmonior:labextension",
77-
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
78-
"watch": "run-p watch:src watch:labextension",
79-
"watch:src": "tsc -w -p tsconfig.lab.json",
80-
"watch:labextension": "jupyter labextension watch .",
81-
"build:nbextension": "webpack --config src/notebook-extension/webpack.config.js",
82-
"watch:nbextension": "webpack --config src/notebook-extension/webpack.config.js --mode development --watch",
83-
"check:all": "jlpm run check:eslint && jlpm run check:nbextension && jlpm run check:labextension",
84-
"check:eslint": "eslint .",
85-
"check:nbextension": "tsc -p tsconfig.notebook.json",
86-
"check:labextension": "tsc -p tsconfig.lab.json --noEmit"
87-
},
88-
"dependencies": {
89-
"@jupyterlab/application": "^3.0.4",
90-
"@jupyterlab/cells": "^3.0.4",
91-
"@jupyterlab/coreutils": "^5.0.2",
92-
"@jupyterlab/docregistry": "^3.0.4",
93-
"@jupyterlab/mainmenu": "^3.0.3",
94-
"@jupyterlab/notebook": "^3.0.4",
95-
"@jupyterlab/services": "^6.0.3",
96-
"@lumino/coreutils": "^1.5.3",
97-
"@lumino/widgets": "^1.16.1",
98-
"es6-promise": "^4.2.8",
99-
"javascript-time-ago": "^2.3.8",
100-
"mobx": "^6.3.2",
101-
"mobx-react-lite": "^3.2.0",
102-
"plotly.js-basic-dist": "^2.3.1",
103-
"pretty-ms": "^7.0.1",
104-
"react-plotly.js": "^2.5.1",
105-
"react-timeago": "^6.2.1",
106-
"react-vis-timeline": "^2.0.3",
107-
"uuid": "^7.0.2",
108-
"vis-timeline": "^7.3.4",
109-
"webpack": "^5.33.2",
110-
"xss": "^1.0.9"
111-
},
112-
"jupyterlab": {
113-
"extension": "lib/lab-extension/index",
114-
"outputDir": "sparkmonitor/labextension"
115-
},
116-
"style": "style/lab.css",
117-
"files": [
118-
"lib/*",
119-
"src/*"
120-
]
2+
"name": "sparkmonitor",
3+
"version": "2.1.1",
4+
"description": "Jupyter Notebook & Lab extension to monitor Apache Spark jobs from a notebook",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+https://github.com/swan-cern/sparkmonitor.git"
8+
},
9+
"keywords": [
10+
"jupyter",
11+
"jupyterlab",
12+
"jupyterlab-extension",
13+
"Spark",
14+
"sparkmonitor"
15+
],
16+
"main": "lib/lab-extension/index.js",
17+
"author": {
18+
"name": "Krishnan R",
19+
"email": "krishnanr1997@gmail.com"
20+
},
21+
"maintainers": [
22+
{
23+
"name": "SWAN Team",
24+
"email": "swan-admins@cern.ch"
25+
}
26+
],
27+
"license": "Apache-2.0",
28+
"bugs": {
29+
"url": "https://github.com/swan-cern/sparkmonitor/issues"
30+
},
31+
"homepage": "https://github.com/swan-cern/sparkmonitor#readme",
32+
"scripts": {
33+
"build:prod": "jlpm run build:lib && jlpm run build:labextension && jlpm run build:nbextension && jlpm run build:scalalistener",
34+
"build": "jlpm run build:lib && jlpm run build:labextension",
35+
"build:lib": "tsc -p tsconfig.lab.json",
36+
"build:labextension": "jupyter labextension build .",
37+
"build:labextension:dev": "jupyter labextension build --development True .",
38+
"build:scalalistener": "cd scalalistener && sbt +assembly",
39+
"clean": "rimraf lib jupyterlab_sparkmonior:labextension",
40+
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
41+
"watch": "run-p watch:src watch:labextension",
42+
"watch:src": "tsc -w -p tsconfig.lab.json",
43+
"watch:labextension": "jupyter labextension watch .",
44+
"build:nbextension": "webpack --config src/notebook-extension/webpack.config.js",
45+
"watch:nbextension": "webpack --config src/notebook-extension/webpack.config.js --mode development --watch",
46+
"check:all": "jlpm run check:eslint && jlpm run check:nbextension && jlpm run check:labextension",
47+
"check:eslint": "eslint .",
48+
"check:nbextension": "tsc -p tsconfig.notebook.json",
49+
"check:labextension": "tsc -p tsconfig.lab.json --noEmit"
50+
},
51+
"dependencies": {
52+
"@jupyterlab/application": "^4.0.9",
53+
"@jupyterlab/apputils": "^4.1.9",
54+
"@jupyterlab/cells": "^4.0.9",
55+
"@jupyterlab/mainmenu": "^4.0.9",
56+
"@jupyterlab/notebook": "^4.0.9",
57+
"@jupyterlab/services": "^7.0.9",
58+
"@lumino/coreutils": "^2.1.2",
59+
"@lumino/widgets": "^2.3.1",
60+
"hammerjs": "^2.0.8",
61+
"keycharm": "^0.4.0",
62+
"mobx": "^6.12.0",
63+
"mobx-react-lite": "^4.0.5",
64+
"moment": "^2.29.4",
65+
"plotly.js-basic-dist": "^2.27.1",
66+
"pretty-ms": "^8.0.0",
67+
"react": "^18.2.0",
68+
"react-dom": "^18.2.0",
69+
"react-plotly.js": "^2.6.0",
70+
"react-timeago": "^7.2.0",
71+
"vis-data": "^7.1.9",
72+
"vis-timeline": "^7.7.3",
73+
"vis-util": "^5.0.7",
74+
"xss": "^1.0.14"
75+
},
76+
"devDependencies": {
77+
"@babel/core": "^7.23.6",
78+
"@babel/preset-env": "^7.23.6",
79+
"@babel/preset-react": "^7.23.3",
80+
"@babel/preset-typescript": "^7.23.3",
81+
"@jupyterlab/builder": "^4.0.0",
82+
"@types/hammerjs": "^2.0.45",
83+
"@types/json-schema": "^7.0.11",
84+
"@types/plotly.js-basic-dist": "^1.54.4",
85+
"@types/react": "^18.0.26",
86+
"@types/react-addons-linked-state-mixin": "^0.14.22",
87+
"@types/react-plotly.js": "^2.6.3",
88+
"@types/react-timeago": "^4.1.6",
89+
"@typescript-eslint/eslint-plugin": "^6.1.0",
90+
"@typescript-eslint/parser": "^6.1.0",
91+
"babel-loader": "^9.1.3",
92+
"css-loader": "^6.7.1",
93+
"eslint": "^8.36.0",
94+
"eslint-config-prettier": "^8.8.0",
95+
"eslint-plugin-prettier": "^5.0.0",
96+
"eslint-plugin-react": "^7.33.2",
97+
"eslint-plugin-react-hooks": "^4.6.0",
98+
"npm-run-all": "^4.1.5",
99+
"prettier": "^3.0.0",
100+
"rimraf": "^5.0.1",
101+
"source-map-loader": "^1.0.2",
102+
"style-loader": "^3.3.1",
103+
"stylelint": "^15.10.1",
104+
"stylelint-config-recommended": "^13.0.0",
105+
"stylelint-config-standard": "^34.0.0",
106+
"stylelint-csstree-validator": "^3.0.0",
107+
"stylelint-prettier": "^4.0.0",
108+
"typescript": "~5.0.2",
109+
"webpack": "^5.89.0",
110+
"yjs": "^13.5.0"
111+
},
112+
"jupyterlab": {
113+
"extension": "lib/lab-extension/index",
114+
"outputDir": "sparkmonitor/labextension"
115+
},
116+
"style": "style/lab.css",
117+
"files": [
118+
"lib/*",
119+
"src/*"
120+
]
121121
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build-system]
2-
requires = ["jupyter_packaging~=0.10.0,<2", "jupyterlab~=3.0", "setuptools>=40.8.0", "wheel"]
2+
requires = ["jupyter_packaging~=0.10.0,<2", "jupyterlab>=4.0.0,<5", "setuptools>=40.8.0", "wheel"]
33
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,26 @@
4242
packages=find_packages(),
4343
license=pkg_json["license"],
4444
zip_safe=False,
45-
python_requires=">=3.6",
45+
python_requires=">=3.8",
4646
data_files=data_files,
4747
install_requires=[
48-
"jupyterlab~=3.0"
48+
"jupyterlab>=4.0.0,<5"
4949
],
5050
platforms="Linux, Mac OS X, Windows",
5151
keywords=["Jupyter", "JupyterLab", "JupyterLab3"],
5252
classifiers=[
53+
"Framework :: Jupyter",
54+
"Framework :: Jupyter :: JupyterLab",
55+
"Framework :: Jupyter :: JupyterLab :: 4",
56+
"Framework :: Jupyter :: JupyterLab :: Extensions",
57+
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
5358
"License :: OSI Approved :: BSD License",
5459
"Programming Language :: Python",
5560
"Programming Language :: Python :: 3",
56-
"Programming Language :: Python :: 3.6",
57-
"Programming Language :: Python :: 3.7",
5861
"Programming Language :: Python :: 3.8",
5962
"Programming Language :: Python :: 3.9",
60-
"Framework :: Jupyter",
63+
"Programming Language :: Python :: 3.10",
64+
"Programming Language :: Python :: 3.11",
65+
"Programming Language :: Python :: 3.12",
6166
],
6267
)

src/lab-extension/current-cell.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default class CurrentCellTracker {
3434
if (!(cellModel.id in this.cellSlotMap)) {
3535
const fn = () => this.cellMetadataChanged(cellModel);
3636
this.cellSlotMap[cellModel.id] = fn;
37-
cellModel.metadata.changed.connect(fn);
37+
cellModel.metadataChanged.connect(fn);
3838
// In case there was already metadata (do not highlight on first load)
3939
this.cellMetadataChanged(cellModel);
4040
}
@@ -43,7 +43,7 @@ export default class CurrentCellTracker {
4343
private deregisterMetadataChanges(cellModel: ICellModel) {
4444
const fn = this.cellSlotMap[cellModel.id];
4545
if (fn) {
46-
cellModel.metadata.changed.disconnect(fn);
46+
cellModel.metadataChanged.disconnect(fn);
4747
}
4848
delete this.cellSlotMap[cellModel.id];
4949
}
@@ -60,7 +60,7 @@ export default class CurrentCellTracker {
6060
const codeCell = this.getCodeCellFromModel(cellModel);
6161

6262
if (codeCell) {
63-
const executionMetadata: any = codeCell.model.metadata.get('execution');
63+
const executionMetadata: any = codeCell.model.metadata['execution'];
6464
if (executionMetadata) {
6565
if (
6666
executionMetadata['iopub.status.busy'] &&

0 commit comments

Comments
 (0)