From db4851184c1ea4f2c1fed8fa99c118ccb906afd2 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Thu, 19 Jun 2025 11:04:06 -0400 Subject: [PATCH 1/2] Add extension json --- jupyter/pyproject.toml.jinja | 2 ++ jupyter/{{module}}/extension/install.json.jinja | 5 +++++ .../extension/{{project_name_formatted}}.json.jinja | 7 +++++++ 3 files changed, 14 insertions(+) create mode 100644 jupyter/{{module}}/extension/install.json.jinja create mode 100644 jupyter/{{module}}/extension/{{project_name_formatted}}.json.jinja diff --git a/jupyter/pyproject.toml.jinja b/jupyter/pyproject.toml.jinja index 92215da..41a1a1b 100644 --- a/jupyter/pyproject.toml.jinja +++ b/jupyter/pyproject.toml.jinja @@ -122,6 +122,8 @@ exclude = ["js"] [tool.hatch.build.targets.wheel.shared-data] "{{module}}/labextension" = "share/jupyter/labextensions/{{module}}" +"{{module}}/extension/install.json" = "share/jupyter/labextensions/{{module}}/install.json" +"{{module}}/extension/{{module}}.json" = "etc/jupyter/jupyter_server_config.d/{{module}}.json" [tool.hatch.build.hooks.jupyter-builder] build-function = "hatch_jupyter_builder.npm_builder" diff --git a/jupyter/{{module}}/extension/install.json.jinja b/jupyter/{{module}}/extension/install.json.jinja new file mode 100644 index 0000000..99f0462 --- /dev/null +++ b/jupyter/{{module}}/extension/install.json.jinja @@ -0,0 +1,5 @@ +{ + "packageManager": "python", + "packageName": "{{project_name_formatted}}", + "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package {{project_name_formatted}}" +} \ No newline at end of file diff --git a/jupyter/{{module}}/extension/{{project_name_formatted}}.json.jinja b/jupyter/{{module}}/extension/{{project_name_formatted}}.json.jinja new file mode 100644 index 0000000..2286256 --- /dev/null +++ b/jupyter/{{module}}/extension/{{project_name_formatted}}.json.jinja @@ -0,0 +1,7 @@ +{ + "ServerApp": { + "jpserver_extensions": { + "{{module}}": true + } + } +} From 4fc2836465bfa36171e101991f799cee901f4318 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Thu, 19 Jun 2025 11:16:49 -0400 Subject: [PATCH 2/2] Tweak hatch excludes slightly for better formatting --- js/pyproject.toml.jinja | 4 +++- jupyter/pyproject.toml.jinja | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/js/pyproject.toml.jinja b/js/pyproject.toml.jinja index 02dfae0..2401979 100644 --- a/js/pyproject.toml.jinja +++ b/js/pyproject.toml.jinja @@ -111,7 +111,9 @@ exclude = [ [tool.hatch.build.targets.wheel] packages = ["{{module}}"] -exclude = ["js"] +exclude = [ + "/js" +] [tool.hatch.build.hooks.jupyter-builder] build-function = "hatch_jupyter_builder.npm_builder" diff --git a/jupyter/pyproject.toml.jinja b/jupyter/pyproject.toml.jinja index 41a1a1b..207e786 100644 --- a/jupyter/pyproject.toml.jinja +++ b/jupyter/pyproject.toml.jinja @@ -118,7 +118,9 @@ exclude = [ [tool.hatch.build.targets.wheel] packages = ["{{module}}"] -exclude = ["js"] +exclude = [ + "/js" +] [tool.hatch.build.targets.wheel.shared-data] "{{module}}/labextension" = "share/jupyter/labextensions/{{module}}"