From 4f4a7d2d0e9a01fdeecd0167b44101226f02e5e0 Mon Sep 17 00:00:00 2001 From: Konstantin Taletskiy Date: Tue, 23 Jan 2024 13:52:01 -0800 Subject: [PATCH 01/13] feat: replace yarn with jlpm --- {{cookiecutter.github_project_name}}/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.github_project_name}}/package.json b/{{cookiecutter.github_project_name}}/package.json index e0053c7..228e7e2 100644 --- a/{{cookiecutter.github_project_name}}/package.json +++ b/{{cookiecutter.github_project_name}}/package.json @@ -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", From d9d4bfcad18e45f7c04aaa8c76d4611e00bd8a61 Mon Sep 17 00:00:00 2001 From: Konstantin Taletskiy Date: Tue, 23 Jan 2024 21:05:03 -0800 Subject: [PATCH 02/13] feat: update typescript and jest --- {{cookiecutter.github_project_name}}/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.github_project_name}}/package.json b/{{cookiecutter.github_project_name}}/package.json index 228e7e2..1111fc1 100644 --- a/{{cookiecutter.github_project_name}}/package.json +++ b/{{cookiecutter.github_project_name}}/package.json @@ -58,7 +58,7 @@ "@jupyterlab/builder": "^3.0.0", "@lumino/application": "^1.6.0", "@lumino/widgets": "^1.6.0", - "@types/jest": "^26.0.0", + "@types/jest": "^29.0.0", "@types/webpack-env": "^1.13.6", "@typescript-eslint/eslint-plugin": "^3.6.0", "@typescript-eslint/parser": "^3.6.0", @@ -69,14 +69,14 @@ "eslint-plugin-prettier": "^3.1.4", "fs-extra": "^7.0.0", "identity-obj-proxy": "^3.0.0", - "jest": "^26.0.0", + "jest": "^29.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-jest": "^29.0.0", "ts-loader": "^8.0.0", "typescript": "~4.1.3", "webpack": "^5.61.0", From 11b4ee695a555f2d666ae0539c2429036a56bb9a Mon Sep 17 00:00:00 2001 From: Konstantin Taletskiy Date: Tue, 23 Jan 2024 22:08:34 -0800 Subject: [PATCH 03/13] feat: update typescript, lumino and jupyterlab packages --- {{cookiecutter.github_project_name}}/package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/{{cookiecutter.github_project_name}}/package.json b/{{cookiecutter.github_project_name}}/package.json index 1111fc1..f0ea62c 100644 --- a/{{cookiecutter.github_project_name}}/package.json +++ b/{{cookiecutter.github_project_name}}/package.json @@ -54,10 +54,10 @@ "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", + "@jupyter-widgets/base-manager": "^1.0.7", + "@jupyterlab/builder": "^3.6.7", + "@lumino/application": "^1.31.4", + "@lumino/widgets": "^1.37.2", "@types/jest": "^29.0.0", "@types/webpack-env": "^1.13.6", "@typescript-eslint/eslint-plugin": "^3.6.0", @@ -78,7 +78,7 @@ "style-loader": "^1.0.0", "ts-jest": "^29.0.0", "ts-loader": "^8.0.0", - "typescript": "~4.1.3", + "typescript": "~5.3.3", "webpack": "^5.61.0", "webpack-cli": "^4.0.0" }, From 42269f5307cb867e52e3657362da072cc9a39c40 Mon Sep 17 00:00:00 2001 From: Konstantin Taletskiy Date: Tue, 23 Jan 2024 22:13:22 -0800 Subject: [PATCH 04/13] docs: remove yarn references and pin jupyterlab --- {{cookiecutter.github_project_name}}/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.github_project_name}}/README.md b/{{cookiecutter.github_project_name}}/README.md index f85ca0f..8dbd685 100644 --- a/{{cookiecutter.github_project_name}}/README.md +++ b/{{cookiecutter.github_project_name}}/README.md @@ -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=3.6.7 conda activate {{ cookiecutter.python_package_name }}-dev ``` @@ -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: @@ -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 ``` From 347dc1040538db4727908840a863240c22e74670 Mon Sep 17 00:00:00 2001 From: Konstantin Taletskiy Date: Wed, 24 Jan 2024 14:27:38 -0800 Subject: [PATCH 05/13] feat: update remaining dependencies and add comments --- .../package.json | 51 ++++++++++--------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/{{cookiecutter.github_project_name}}/package.json b/{{cookiecutter.github_project_name}}/package.json index f0ea62c..85528d3 100644 --- a/{{cookiecutter.github_project_name}}/package.json +++ b/{{cookiecutter.github_project_name}}/package.json @@ -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", + "@babel/core": "^7.23.7", + "@babel/preset-env": "^7.23.8", "@jupyter-widgets/base-manager": "^1.0.7", "@jupyterlab/builder": "^3.6.7", "@lumino/application": "^1.31.4", "@lumino/widgets": "^1.37.2", - "@types/jest": "^29.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", + "@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": "^29.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": "^29.0.0", - "ts-loader": "^8.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.61.0", - "webpack-cli": "^4.0.0" + "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", From 44ea9da18a82dc131d26afa15544dcd37535f229 Mon Sep 17 00:00:00 2001 From: Konstantin Taletskiy Date: Thu, 25 Jan 2024 00:03:28 -0800 Subject: [PATCH 06/13] feat: bump to JupyterLab 4 and Lumino 2 --- {{cookiecutter.github_project_name}}/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.github_project_name}}/package.json b/{{cookiecutter.github_project_name}}/package.json index 85528d3..dbe7a7e 100644 --- a/{{cookiecutter.github_project_name}}/package.json +++ b/{{cookiecutter.github_project_name}}/package.json @@ -55,9 +55,9 @@ "@babel/core": "^7.23.7", "@babel/preset-env": "^7.23.8", "@jupyter-widgets/base-manager": "^1.0.7", - "@jupyterlab/builder": "^3.6.7", - "@lumino/application": "^1.31.4", - "@lumino/widgets": "^1.37.2", + "@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", From a6822e07f63a12db1e9843de4e88d54b72b3c194 Mon Sep 17 00:00:00 2001 From: Konstantin Taletskiy Date: Thu, 25 Jan 2024 14:24:23 -0800 Subject: [PATCH 07/13] Update dependencies and Python version in pyproject.toml --- {{cookiecutter.github_project_name}}/pyproject.toml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/{{cookiecutter.github_project_name}}/pyproject.toml b/{{cookiecutter.github_project_name}}/pyproject.toml index 906333c..74d0b72 100644 --- a/{{cookiecutter.github_project_name}}/pyproject.toml +++ b/{{cookiecutter.github_project_name}}/pyproject.toml @@ -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" @@ -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 }}" }, ] @@ -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" @@ -86,7 +89,7 @@ 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] From eae58d2e04f39d4b450867c51266f433cefc9af9 Mon Sep 17 00:00:00 2001 From: Konstantin Taletskiy Date: Thu, 25 Jan 2024 15:42:02 -0800 Subject: [PATCH 08/13] Add .yarnrc.yml and update pyproject.toml --- .yarnrc.yml | 1 + {{cookiecutter.github_project_name}}/pyproject.toml | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 .yarnrc.yml diff --git a/.yarnrc.yml b/.yarnrc.yml new file mode 100644 index 0000000..3186f3f --- /dev/null +++ b/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/{{cookiecutter.github_project_name}}/pyproject.toml b/{{cookiecutter.github_project_name}}/pyproject.toml index 74d0b72..7ffb155 100644 --- a/{{cookiecutter.github_project_name}}/pyproject.toml +++ b/{{cookiecutter.github_project_name}}/pyproject.toml @@ -60,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.*", @@ -95,6 +98,7 @@ dependencies = [ [tool.hatch.build.hooks.jupyter-builder.build-kwargs] path = "." build_cmd = "build:prod" +npm = ["jlpm"] [tool.tbump] field = [ From bd2e73c6fe41c16d6de606debd20dd5899a4c2b6 Mon Sep 17 00:00:00 2001 From: Konstantin Taletskiy Date: Thu, 25 Jan 2024 15:58:15 -0800 Subject: [PATCH 09/13] fix: move .yarnrc.yml to ther correct folder --- .yarnrc.yml => {{cookiecutter.github_project_name}}/.yarnrc.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .yarnrc.yml => {{cookiecutter.github_project_name}}/.yarnrc.yml (100%) diff --git a/.yarnrc.yml b/{{cookiecutter.github_project_name}}/.yarnrc.yml similarity index 100% rename from .yarnrc.yml rename to {{cookiecutter.github_project_name}}/.yarnrc.yml From 6fbee4a1eb80b7b3bdc1ecc0325eecfaf356d8d0 Mon Sep 17 00:00:00 2001 From: Konstantin Taletskiy Date: Sun, 28 Jan 2024 15:49:55 -0800 Subject: [PATCH 10/13] Update README.md --- {{cookiecutter.github_project_name}}/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.github_project_name}}/README.md b/{{cookiecutter.github_project_name}}/README.md index 8dbd685..4327a4c 100644 --- a/{{cookiecutter.github_project_name}}/README.md +++ b/{{cookiecutter.github_project_name}}/README.md @@ -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 python jupyterlab=3.6.7 +conda create -n {{ cookiecutter.python_package_name }}-dev -c conda-forge nodejs python jupyterlab=4.0.11 conda activate {{ cookiecutter.python_package_name }}-dev ``` From 42dea00e4a81c3bdf9d560c20e8cd1bf4ac06ba0 Mon Sep 17 00:00:00 2001 From: Konstantin Taletskiy Date: Mon, 29 Jan 2024 15:31:12 -0800 Subject: [PATCH 11/13] Update __init__.py --- .../{{cookiecutter.python_package_name}}/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.github_project_name}}/{{cookiecutter.python_package_name}}/__init__.py b/{{cookiecutter.github_project_name}}/{{cookiecutter.python_package_name}}/__init__.py index 5e5ef7a..b3a673b 100644 --- a/{{cookiecutter.github_project_name}}/{{cookiecutter.python_package_name}}/__init__.py +++ b/{{cookiecutter.github_project_name}}/{{cookiecutter.python_package_name}}/__init__.py @@ -44,6 +44,6 @@ def _jupyter_nbextension_paths(): return [{ 'section': 'notebook', 'src': 'nbextension', - 'dest': '{{ cookiecutter.python_package_name }}', + 'dest': '{{ cookiecutter.npm_package_name}}', 'require': '{{ cookiecutter.python_package_name }}/extension' }] From 1f61d39382833404ed9151a711494bd01d29b9a2 Mon Sep 17 00:00:00 2001 From: Konstantin Taletskiy Date: Mon, 29 Jan 2024 15:46:31 -0800 Subject: [PATCH 12/13] Revert previous --- .../{{cookiecutter.python_package_name}}/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.github_project_name}}/{{cookiecutter.python_package_name}}/__init__.py b/{{cookiecutter.github_project_name}}/{{cookiecutter.python_package_name}}/__init__.py index b3a673b..5e5ef7a 100644 --- a/{{cookiecutter.github_project_name}}/{{cookiecutter.python_package_name}}/__init__.py +++ b/{{cookiecutter.github_project_name}}/{{cookiecutter.python_package_name}}/__init__.py @@ -44,6 +44,6 @@ def _jupyter_nbextension_paths(): return [{ 'section': 'notebook', 'src': 'nbextension', - 'dest': '{{ cookiecutter.npm_package_name}}', + 'dest': '{{ cookiecutter.python_package_name }}', 'require': '{{ cookiecutter.python_package_name }}/extension' }] From eb0fe2f295f5550189b17a69c8fd30f01b4cc546 Mon Sep 17 00:00:00 2001 From: Konstantin Taletskiy Date: Mon, 29 Jan 2024 16:20:43 -0800 Subject: [PATCH 13/13] fix: javascript error for project with hyphen --- {{cookiecutter.github_project_name}}/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.github_project_name}}/pyproject.toml b/{{cookiecutter.github_project_name}}/pyproject.toml index 7ffb155..c49191a 100644 --- a/{{cookiecutter.github_project_name}}/pyproject.toml +++ b/{{cookiecutter.github_project_name}}/pyproject.toml @@ -72,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]