Hatch Jupyter Builder Plugin

0.9.1 · active · verified Thu Apr 16

Hatch Jupyter Builder is a Hatch plugin designed to streamline the building and packaging of Jupyter-related projects, such as JupyterLab extensions, JupyterLite applications, and kernels. It integrates frontend build steps (e.g., npm/yarn) directly into the Python packaging process, ensuring consistent builds and proper inclusion of static assets. The current version is 0.9.1, with a release cadence of regular patch and minor updates addressing bug fixes and enhancements.

Common errors

Warnings

Install

Imports

Quickstart

This `pyproject.toml` snippet demonstrates how to configure `hatch-jupyter-builder` for a project that includes a JavaScript/TypeScript frontend. It enables the 'jupyter' builder for wheel targets and defines a `jupyter` build hook to execute `npm` commands within a specified `build-dir`.

# pyproject.toml
[build-system]
requires = ["hatchling>=1.5", "hatch-jupyter-builder>=0.9.0"]
build-backend = "hatchling.build"

[project]
name = "my-jupyter-pkg"
version = "0.1.0"
requires-python = ">=3.8"
description = "A Jupyter package built with hatch-jupyter-builder."

[tool.hatch.build.targets.wheel]
builder = "jupyter"

[tool.hatch.build.hooks.jupyter]
# Directory containing package.json for frontend (relative to pyproject.toml)
build-dir = "js"
# Commands to run for frontend build
npm = ["install", "run", "build"]
# Files that must exist after the frontend build to indicate success
# ensured-targets = [
#     "my_jupyter_pkg/static/main.js"
# ]

view raw JSON →