Skip to content

Commit

Permalink
Merge pull request #143 from PolusAI/4.0.11
Browse files Browse the repository at this point in the history
Update to the latest JupyterLab 4.x (4.0.11)
  • Loading branch information
ibdafna authored Feb 8, 2024
2 parents 94f9d38 + eb0fe2f commit 7e3339c
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 42 deletions.
1 change: 1 addition & 0 deletions {{cookiecutter.github_project_name}}/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
6 changes: 3 additions & 3 deletions {{cookiecutter.github_project_name}}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jupyter nbextension enable --py [--sys-prefix|--user|--system] {{ cookiecutter.p

Create a dev environment:
```bash
conda create -n {{ cookiecutter.python_package_name }}-dev -c conda-forge nodejs yarn python jupyterlab
conda create -n {{ cookiecutter.python_package_name }}-dev -c conda-forge nodejs python jupyterlab=4.0.11
conda activate {{ cookiecutter.python_package_name }}-dev
```

Expand All @@ -39,7 +39,7 @@ notebook / lab frontend. For lab, this is done by the command:

```
jupyter labextension develop --overwrite .
yarn run build
jlpm run build
```

For classic notebook, you need to run:
Expand All @@ -61,7 +61,7 @@ terminals to watch for changes in the extension's source and automatically rebui

```bash
# Watch the source directory in one terminal, automatically rebuilding when needed
yarn run watch
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab
```
Expand Down
69 changes: 37 additions & 32 deletions {{cookiecutter.github_project_name}}/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
"url": "https://github.com/{{ cookiecutter.github_organization_name }}/{{ cookiecutter.github_project_name }}"
},
"scripts": {
"build": "yarn run build:lib && yarn run build:nbextension && yarn run build:labextension:dev",
"build:prod": "yarn run build:lib && yarn run build:nbextension && yarn run build:labextension",
"build": "jlpm run build:lib && jlpm run build:nbextension && jlpm run build:labextension:dev",
"build:prod": "jlpm run build:lib && jlpm run build:nbextension && jlpm run build:labextension",
"build:labextension": "jupyter labextension build .",
"build:labextension:dev": "jupyter labextension build --development True .",
"build:lib": "tsc",
"build:nbextension": "webpack",
"clean": "yarn run clean:lib && yarn run clean:nbextension && yarn run clean:labextension",
"clean": "jlpm run clean:lib && jlpm run clean:nbextension && jlpm run clean:labextension",
"clean:lib": "rimraf lib",
"clean:labextension": "rimraf {{ cookiecutter.python_package_name }}/labextension",
"clean:nbextension": "rimraf {{ cookiecutter.python_package_name }}/nbextension/static/index.js",
"lint": "eslint . --ext .ts,.tsx --fix",
"lint:check": "eslint . --ext .ts,.tsx",
"prepack": "yarn run build:lib",
"prepack": "jlpm run build:lib",
"test": "jest",
"watch": "npm-run-all -p watch:*",
"watch:lib": "tsc -w",
Expand All @@ -52,35 +52,40 @@
"@jupyter-widgets/base": "^1.1.10 || ^2 || ^3 || ^4 || ^5 || ^6"
},
"devDependencies": {
"@babel/core": "^7.5.0",
"@babel/preset-env": "^7.5.0",
"@jupyter-widgets/base-manager": "^1.0.2",
"@jupyterlab/builder": "^3.0.0",
"@lumino/application": "^1.6.0",
"@lumino/widgets": "^1.6.0",
"@types/jest": "^26.0.0",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^3.6.0",
"@typescript-eslint/parser": "^3.6.0",
"acorn": "^7.2.0",
"css-loader": "^3.2.0",
"eslint": "^7.4.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"fs-extra": "^7.0.0",
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.8",
"@jupyter-widgets/base-manager": "^1.0.7",
"@jupyterlab/builder": "^4.0.11",
"@lumino/application": "^2.3.0",
"@lumino/widgets": "^2.3.1",
"@types/jest": "^29.5.11",
"@types/webpack-env": "^1.18.4",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"acorn": "^8.11.3",
"css-loader": "^6.9.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"fs-extra": "^11.2.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.0.0",
"mkdirp": "^0.5.1",
"npm-run-all": "^4.1.3",
"prettier": "^2.0.5",
"rimraf": "^2.6.2",
"source-map-loader": "^1.1.3",
"style-loader": "^1.0.0",
"ts-jest": "^26.0.0",
"ts-loader": "^8.0.0",
"typescript": "~4.1.3",
"webpack": "^5.61.0",
"webpack-cli": "^4.0.0"
"jest": "^29.7.0",
"mkdirp": "^3.0.1",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.4",
"rimraf": "^5.0.5",
"source-map-loader": "^5.0.0",
"style-loader": "^3.3.4",
"ts-jest": "^29.1.2",
"ts-loader": "^9.5.1",
"typescript": "~5.3.3",
"webpack": "^5.90.0",
"webpack-cli": "^5.1.4"
},
"devDependenciesComments": {
"@jupyterlab/builder": "pinned to the latest JupyterLab 3.x release",
"@lumino/application": "pinned to the latest Lumino 1.x release",
"@lumino/widgets": "pinned to the latest Lumino 1.x release"
},
"jupyterlab": {
"extension": "lib/plugin",
Expand Down
21 changes: 14 additions & 7 deletions {{cookiecutter.github_project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[build-system]
requires = [
"hatchling>=1.3.1",
"jupyterlab==3.*",
"hatchling>=1.21.1",
"jupyterlab>=4.0.0,<5",
"hatch-nodejs-version>=0.3.2",
]
build-backend = "hatchling.build"

Expand All @@ -10,7 +11,7 @@ name = "{{ cookiecutter.python_package_name }}"
description = "{{ cookiecutter.project_short_description }}"
readme = "README.md"
license = { file = "LICENSE.txt" }
requires-python = ">=3.7"
requires-python = ">=3.9"
authors = [
{ name = "{{ cookiecutter.author_name }}", email = "{{ cookiecutter.author_email }}" },
]
Expand All @@ -30,9 +31,11 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"ipywidgets>=7.0.0",
"ipywidgets>=8.0.0",
]
version = "0.1.0.dev0"

Expand All @@ -57,6 +60,9 @@ test = [
[project.urls]
Homepage = "https://github.com/{{ cookiecutter.github_organization_name }}/{{ cookiecutter.github_project_name }}"

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.build]
artifacts = [
"{{ cookiecutter.python_package_name }}/nbextension/index.*",
Expand All @@ -66,8 +72,8 @@ artifacts = [

[tool.hatch.build.targets.wheel.shared-data]
"{{ cookiecutter.python_package_name }}/nbextension" = "share/jupyter/nbextensions/{{ cookiecutter.python_package_name }}"
"{{ cookiecutter.python_package_name }}/labextension" = "share/jupyter/labextensions/{{ cookiecutter.python_package_name }}"
"./install.json" = "share/jupyter/labextensions/{{ cookiecutter.python_package_name }}/install.json"
"{{ cookiecutter.python_package_name }}/labextension" = "share/jupyter/labextensions/{{ cookiecutter.npm_package_name }}"
"./install.json" = "share/jupyter/labextensions/{{ cookiecutter.npm_package_name }}/install.json"
"./{{ cookiecutter.python_package_name }}.json" = "etc/jupyter/nbconfig/notebook.d/{{ cookiecutter.python_package_name }}.json"

[tool.hatch.build.targets.sdist]
Expand All @@ -86,12 +92,13 @@ skip-if-exists = [
"{{ cookiecutter.python_package_name }}/labextension/package.json",
]
dependencies = [
"hatch-jupyter-builder>=0.5.0",
"hatch-jupyter-builder>=0.8.3",
]

[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
path = "."
build_cmd = "build:prod"
npm = ["jlpm"]

[tool.tbump]
field = [
Expand Down

0 comments on commit 7e3339c

Please sign in to comment.