Skip to content

Commit

Permalink
Update to Jupyterlab 4 (#195)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
jtpio and pre-commit-ci[bot] authored Jul 19, 2023
1 parent 3cc2ee2 commit 8a51d50
Show file tree
Hide file tree
Showing 11 changed files with 10,008 additions and 7,646 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

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

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

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

- name: Install the extension
run: |
python -m pip install .
jupyter server extension enable --py jupyter_resource_usage --sys-prefix
jupyter serverextension enable --py jupyter_resource_usage --sys-prefix
jupyter nbextension install --py jupyter_resource_usage --sys-prefix
jupyter nbextension enable --py jupyter_resource_usage --sys-prefix
jupyter nbclassic-serverextension enable --py jupyter_resource_usage --sys-prefix
jupyter nbclassic-extension install --py jupyter_resource_usage --sys-prefix
jupyter nbclassic-extension enable --py jupyter_resource_usage --sys-prefix
- name: Check the server, classic and lab extensions are installed
run: |
jupyter serverextension list 2>&1 | grep -ie "jupyter_resource_usage.*enabled"
jupyter server extension list 2>&1 | grep -ie "jupyter_resource_usage.*enabled"
jupyter nbextension list 2>&1 | grep -ie "jupyter_resource_usage/main.*enabled"
jupyter nbclassic-serverextension list 2>&1 | grep -ie "jupyter_resource_usage.*enabled"
jupyter nbclassic-extension list 2>&1 | grep -ie "jupyter_resource_usage/main.*enabled"
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "@jupyter-server/resource-usage.*OK"
python -m jupyterlab.browser_check
2 changes: 1 addition & 1 deletion .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
check_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Check Release
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip black jupyterlab~=3.0
python -m pip install --upgrade pip black jupyterlab~=4.0
- name: Lint Python
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

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

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
Expand All @@ -37,6 +37,6 @@ jobs:
check_links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ node_modules/
*.tsbuildinfo
jupyter_resource_usage/labextension
yarn-error.log
.yarn/
.pnp*
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
enableImmutableInstalls: false
nodeLinker: node-modules
4 changes: 2 additions & 2 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ channels:
- conda-forge
dependencies:
- python=3
- jupyterlab=3
- nodejs
- jupyterlab=4
- nodejs=18
25 changes: 20 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,44 @@
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "interface",
"format": ["PascalCase"],
"format": [
"PascalCase"
],
"custom": {
"regex": "^I[A-Z]",
"match": true
}
}
],
"@typescript-eslint/no-unused-vars": ["warn", { "args": "none" }],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "none"
}
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/quotes": [
"error",
"single",
{ "avoidEscape": true, "allowTemplateLiterals": false }
{
"avoidEscape": true,
"allowTemplateLiterals": false
}
],
"curly": [
"error",
"all"
],
"curly": ["error", "all"],
"eqeqeq": "error",
"prefer-arrow-callback": "error"
}
Expand Down
22 changes: 11 additions & 11 deletions packages/labextension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@
"watch:labextension": "jupyter labextension watch ."
},
"dependencies": {
"@jupyterlab/application": "^3.5.1",
"@jupyterlab/apputils": "^3.5.1",
"@jupyterlab/console": "^3.5.1",
"@jupyterlab/coreutils": "^5.5.1",
"@jupyterlab/notebook": "^3.5.1",
"@jupyterlab/services": "^6.5.1",
"@jupyterlab/statusbar": "^3.5.1",
"@jupyterlab/translation": "^3.5.1",
"@lumino/polling": "^1.11.3",
"@jupyterlab/application": "^4.0.0",
"@jupyterlab/apputils": "^4.0.0",
"@jupyterlab/console": "^4.0.0",
"@jupyterlab/coreutils": "^6.0.0",
"@jupyterlab/notebook": "^4.0.0",
"@jupyterlab/services": "^7.0.0",
"@jupyterlab/statusbar": "^4.0.0",
"@jupyterlab/translation": "^4.0.0",
"@lumino/polling": "^2.1.1",
"typestyle": "^2.4.0"
},
"devDependencies": {
"@jupyterlab/builder": "^3.5.1",
"@jupyterlab/builder": "^4.0.0",
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
"eslint": "^7.14.0",
Expand All @@ -64,7 +64,7 @@
"npm-run-all": "^4.1.5",
"prettier": "^2.1.1",
"rimraf": "^3.0.2",
"typescript": "~4.1.3"
"typescript": "~5.0.0"
},
"sideEffects": [
"style/*.css",
Expand Down
23 changes: 10 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[build-system]
requires = [
"hatchling",
"jupyterlab~=3.0",
"hatchling>=1.5.0",
"jupyterlab>=4.0,<5",
"pip",
]
build-backend = "hatchling.build"

Expand All @@ -21,7 +22,7 @@ keywords = [
classifiers = [
"Framework :: Jupyter",
"Framework :: Jupyter :: JupyterLab",
"Framework :: Jupyter :: JupyterLab :: 3",
"Framework :: Jupyter :: JupyterLab :: 4",
"Framework :: Jupyter :: JupyterLab :: Extensions",
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
"Intended Audience :: Developers",
Expand All @@ -36,7 +37,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
]
dependencies = [
"jupyter_server>=1.0",
"jupyter_server>=2.0",
"prometheus_client",
"psutil~=5.6",
"pyzmq>=19",
Expand All @@ -61,8 +62,7 @@ Homepage = "https://github.com/jupyter-server/jupyter-resource-usage"

[tool.hatch.build.targets.wheel.shared-data]
"jupyter_resource_usage/static" = "share/jupyter/nbextensions/jupyter_resource_usage"
"jupyter_resource_usage/labextension/package.json" = "share/jupyter/labextensions/@jupyter-server/resource-usage/package.json"
"jupyter_resource_usage/labextension/static" = "share/jupyter/labextensions/@jupyter-server/resource-usage/static"
"jupyter_resource_usage/labextension" = "share/jupyter/labextensions/@jupyter-server/resource-usage"
"install.json" = "share/jupyter/labextensions/@jupyter-server/resource-usage/install.json"
"jupyter-config/jupyter_server_config.d" = "etc/jupyter/jupyter_server_config.d"
"jupyter-config/jupyter_notebook_config.d" = "etc/jupyter/jupyter_notebook_config.d"
Expand All @@ -88,20 +88,17 @@ skip-if-exists = [
"jupyter_resource_usage/labextension/static/style.js",
]

[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs]
[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
build_cmd = "build:prod"
npm = [
"jlpm",
]
force = true

[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
build_cmd = "build:prod"
[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs]
build_cmd = "build"
npm = [
"jlpm",
]
source_dir = "packages/labextension"
build_dir = "jupyter_resource_usage/labextension"

[tool.tbump.version]
current = "0.7.2"
Expand Down Expand Up @@ -130,7 +127,7 @@ default = ""

[tool.jupyter-releaser.hooks]
before-build-npm = [
"python -m pip install jupyterlab~=3.0",
"python -m pip install jupyterlab~=4.0",
"jlpm",
"jlpm clean",
"jlpm build:prod",
Expand Down
Loading

0 comments on commit 8a51d50

Please sign in to comment.