From a40e6f69fb8d6d74014bfa36fea80553fcdf1c5e Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 13 Apr 2025 05:21:51 +0000 Subject: [PATCH] Update from copier (2025-04-13T05:21:51) --- .copier-answers.yml | 2 +- .gitignore | 1 + pyproject.toml | 7 +++++++ python_template_jupyter/__init__.py | 29 +++++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index c3df63a..79f6f78 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: 5da0277 +_commit: 98c8f14 _src_path: https://github.com/python-project-templates/base.git add_extension: jupyter email: 3105306+timkpaine@users.noreply.github.com diff --git a/.gitignore b/.gitignore index 96ac9d5..f78c583 100644 --- a/.gitignore +++ b/.gitignore @@ -134,6 +134,7 @@ _template/labextension # JS js/coverage js/dist +js/lib js/node_modules python_template_jupyter/extension diff --git a/pyproject.toml b/pyproject.toml index 9270f45..6f97027 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,8 @@ keywords = [] classifiers = [ "Development Status :: 3 - Alpha", + "Framework :: Jupyter", + "Framework :: Jupyter :: JupyterLab", "Programming Language :: Python", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", @@ -26,6 +28,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] dependencies = [] @@ -79,6 +82,8 @@ ignore = [ "python_template_jupyter/labextension/**", "python_template_jupyter/nbextension/**", "docs/**/*", + "js/dist/**/*", + "js/lib/*", ] [tool.coverage.run] @@ -120,9 +125,11 @@ packages = ["python_template_jupyter"] [tool.hatch.build.hooks.jupyter-builder] build-function = "hatch_jupyter_builder.npm_builder" ensured-targets = [ + "python_template_jupyter/nbextension/static/notebook.js", "python_template_jupyter/labextension/package.json", ] skip-if-exists = [ + "python_template_jupyter/nbextension/static/notebook.js", "python_template_jupyter/labextension/package.json", ] dependencies = [ diff --git a/python_template_jupyter/__init__.py b/python_template_jupyter/__init__.py index 3dc1f76..624b377 100644 --- a/python_template_jupyter/__init__.py +++ b/python_template_jupyter/__init__.py @@ -1 +1,30 @@ __version__ = "0.1.0" + + +def _jupyter_server_extension_paths(): + return [{"module": "python_template_jupyter"}] + + +def _jupyter_server_extension_points(): + return [{"module": "python_template_jupyter"}] + + +def _load_jupyter_server_extension(nb_server_app, nb6_entrypoint=False): + """ + Called when the extension is loaded. + + Args: + nb_server_app (NotebookWebApplication): handle to the Notebook webserver instance. + """ + # web_app = nb_server_app.web_app + + +def _jupyter_nbextension_paths(): + return [ + { + "section": "tree", + "src": "nbextension/static", + "dest": "python_template_jupyter", + "require": "python_template_jupyter/notebook", + } + ]