Skip to content

Commit 8a51d50

Browse files
Update to Jupyterlab 4 (#195)
* Update to JupyterLab 4 * Update to TypeScript 5 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix services version * Bump `jupyter-server` * Install `nbclassic` on CI * Switch to `nbclassic-extension` * Drop `jupyter serverextension` * debug * simplify hatch shared-data * align versions * align hooks with template * Update yarn.lock * Add `nbclassic-serverextension` commands * Bump to `actions/checkout@v3` * Update pyproject * debug * update pyproject * debug * debug * Fix coreutils dep * debug --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 3cc2ee2 commit 8a51d50

File tree

11 files changed

+10008
-7646
lines changed

11 files changed

+10008
-7646
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,30 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1515

1616
- name: Checkout
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v3
1818

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

2222
- name: Install dependencies
23-
run: python -m pip install jupyterlab~=3.0
23+
run: python -m pip install jupyterlab~=4.0 nbclassic~=1.0
2424

2525
- name: Install the extension
2626
run: |
2727
python -m pip install .
2828
jupyter server extension enable --py jupyter_resource_usage --sys-prefix
29-
jupyter serverextension enable --py jupyter_resource_usage --sys-prefix
30-
jupyter nbextension install --py jupyter_resource_usage --sys-prefix
31-
jupyter nbextension enable --py jupyter_resource_usage --sys-prefix
29+
jupyter nbclassic-serverextension enable --py jupyter_resource_usage --sys-prefix
30+
jupyter nbclassic-extension install --py jupyter_resource_usage --sys-prefix
31+
jupyter nbclassic-extension enable --py jupyter_resource_usage --sys-prefix
3232
3333
- name: Check the server, classic and lab extensions are installed
3434
run: |
35-
jupyter serverextension list 2>&1 | grep -ie "jupyter_resource_usage.*enabled"
3635
jupyter server extension list 2>&1 | grep -ie "jupyter_resource_usage.*enabled"
37-
jupyter nbextension list 2>&1 | grep -ie "jupyter_resource_usage/main.*enabled"
36+
jupyter nbclassic-serverextension list 2>&1 | grep -ie "jupyter_resource_usage.*enabled"
37+
jupyter nbclassic-extension list 2>&1 | grep -ie "jupyter_resource_usage/main.*enabled"
38+
jupyter labextension list
3839
jupyter labextension list 2>&1 | grep -ie "@jupyter-server/resource-usage.*OK"
3940
python -m jupyterlab.browser_check

.github/workflows/check-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
check_release:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
1919
- name: Check Release
2020
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1717

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

2121
- name: Install dependencies
2222
run: |
23-
python -m pip install --upgrade pip black jupyterlab~=3.0
23+
python -m pip install --upgrade pip black jupyterlab~=4.0
2424
2525
- name: Lint Python
2626
run: |

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v2
20+
uses: actions/checkout@v3
2121

2222
- name: Base Setup
2323
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
@@ -37,6 +37,6 @@ jobs:
3737
check_links:
3838
runs-on: ubuntu-latest
3939
steps:
40-
- uses: actions/checkout@v2
40+
- uses: actions/checkout@v3
4141
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
4242
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ node_modules/
4242
*.tsbuildinfo
4343
jupyter_resource_usage/labextension
4444
yarn-error.log
45+
.yarn/
46+
.pnp*

.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

binder/environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ channels:
33
- conda-forge
44
dependencies:
55
- python=3
6-
- jupyterlab=3
7-
- nodejs
6+
- jupyterlab=4
7+
- nodejs=18

package.json

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,29 +59,44 @@
5959
"plugin:prettier/recommended"
6060
],
6161
"parser": "@typescript-eslint/parser",
62-
"plugins": ["@typescript-eslint"],
62+
"plugins": [
63+
"@typescript-eslint"
64+
],
6365
"rules": {
6466
"@typescript-eslint/naming-convention": [
6567
"error",
6668
{
6769
"selector": "interface",
68-
"format": ["PascalCase"],
70+
"format": [
71+
"PascalCase"
72+
],
6973
"custom": {
7074
"regex": "^I[A-Z]",
7175
"match": true
7276
}
7377
}
7478
],
75-
"@typescript-eslint/no-unused-vars": ["warn", { "args": "none" }],
79+
"@typescript-eslint/no-unused-vars": [
80+
"warn",
81+
{
82+
"args": "none"
83+
}
84+
],
7685
"@typescript-eslint/no-explicit-any": "off",
7786
"@typescript-eslint/no-namespace": "off",
7887
"@typescript-eslint/no-use-before-define": "off",
7988
"@typescript-eslint/quotes": [
8089
"error",
8190
"single",
82-
{ "avoidEscape": true, "allowTemplateLiterals": false }
91+
{
92+
"avoidEscape": true,
93+
"allowTemplateLiterals": false
94+
}
95+
],
96+
"curly": [
97+
"error",
98+
"all"
8399
],
84-
"curly": ["error", "all"],
85100
"eqeqeq": "error",
86101
"prefer-arrow-callback": "error"
87102
}

packages/labextension/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@
4242
"watch:labextension": "jupyter labextension watch ."
4343
},
4444
"dependencies": {
45-
"@jupyterlab/application": "^3.5.1",
46-
"@jupyterlab/apputils": "^3.5.1",
47-
"@jupyterlab/console": "^3.5.1",
48-
"@jupyterlab/coreutils": "^5.5.1",
49-
"@jupyterlab/notebook": "^3.5.1",
50-
"@jupyterlab/services": "^6.5.1",
51-
"@jupyterlab/statusbar": "^3.5.1",
52-
"@jupyterlab/translation": "^3.5.1",
53-
"@lumino/polling": "^1.11.3",
45+
"@jupyterlab/application": "^4.0.0",
46+
"@jupyterlab/apputils": "^4.0.0",
47+
"@jupyterlab/console": "^4.0.0",
48+
"@jupyterlab/coreutils": "^6.0.0",
49+
"@jupyterlab/notebook": "^4.0.0",
50+
"@jupyterlab/services": "^7.0.0",
51+
"@jupyterlab/statusbar": "^4.0.0",
52+
"@jupyterlab/translation": "^4.0.0",
53+
"@lumino/polling": "^2.1.1",
5454
"typestyle": "^2.4.0"
5555
},
5656
"devDependencies": {
57-
"@jupyterlab/builder": "^3.5.1",
57+
"@jupyterlab/builder": "^4.0.0",
5858
"@typescript-eslint/eslint-plugin": "^4.8.1",
5959
"@typescript-eslint/parser": "^4.8.1",
6060
"eslint": "^7.14.0",
@@ -64,7 +64,7 @@
6464
"npm-run-all": "^4.1.5",
6565
"prettier": "^2.1.1",
6666
"rimraf": "^3.0.2",
67-
"typescript": "~4.1.3"
67+
"typescript": "~5.0.0"
6868
},
6969
"sideEffects": [
7070
"style/*.css",

pyproject.toml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[build-system]
22
requires = [
3-
"hatchling",
4-
"jupyterlab~=3.0",
3+
"hatchling>=1.5.0",
4+
"jupyterlab>=4.0,<5",
5+
"pip",
56
]
67
build-backend = "hatchling.build"
78

@@ -21,7 +22,7 @@ keywords = [
2122
classifiers = [
2223
"Framework :: Jupyter",
2324
"Framework :: Jupyter :: JupyterLab",
24-
"Framework :: Jupyter :: JupyterLab :: 3",
25+
"Framework :: Jupyter :: JupyterLab :: 4",
2526
"Framework :: Jupyter :: JupyterLab :: Extensions",
2627
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
2728
"Intended Audience :: Developers",
@@ -36,7 +37,7 @@ classifiers = [
3637
"Programming Language :: Python :: 3.11",
3738
]
3839
dependencies = [
39-
"jupyter_server>=1.0",
40+
"jupyter_server>=2.0",
4041
"prometheus_client",
4142
"psutil~=5.6",
4243
"pyzmq>=19",
@@ -61,8 +62,7 @@ Homepage = "https://github.com/jupyter-server/jupyter-resource-usage"
6162

6263
[tool.hatch.build.targets.wheel.shared-data]
6364
"jupyter_resource_usage/static" = "share/jupyter/nbextensions/jupyter_resource_usage"
64-
"jupyter_resource_usage/labextension/package.json" = "share/jupyter/labextensions/@jupyter-server/resource-usage/package.json"
65-
"jupyter_resource_usage/labextension/static" = "share/jupyter/labextensions/@jupyter-server/resource-usage/static"
65+
"jupyter_resource_usage/labextension" = "share/jupyter/labextensions/@jupyter-server/resource-usage"
6666
"install.json" = "share/jupyter/labextensions/@jupyter-server/resource-usage/install.json"
6767
"jupyter-config/jupyter_server_config.d" = "etc/jupyter/jupyter_server_config.d"
6868
"jupyter-config/jupyter_notebook_config.d" = "etc/jupyter/jupyter_notebook_config.d"
@@ -88,20 +88,17 @@ skip-if-exists = [
8888
"jupyter_resource_usage/labextension/static/style.js",
8989
]
9090

91-
[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs]
91+
[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
9292
build_cmd = "build:prod"
9393
npm = [
9494
"jlpm",
9595
]
96-
force = true
9796

98-
[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
99-
build_cmd = "build:prod"
97+
[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs]
98+
build_cmd = "build"
10099
npm = [
101100
"jlpm",
102101
]
103-
source_dir = "packages/labextension"
104-
build_dir = "jupyter_resource_usage/labextension"
105102

106103
[tool.tbump.version]
107104
current = "0.7.2"
@@ -130,7 +127,7 @@ default = ""
130127

131128
[tool.jupyter-releaser.hooks]
132129
before-build-npm = [
133-
"python -m pip install jupyterlab~=3.0",
130+
"python -m pip install jupyterlab~=4.0",
134131
"jlpm",
135132
"jlpm clean",
136133
"jlpm build:prod",

0 commit comments

Comments
 (0)