A hatch plugin to help build Jupyter packages
Project description
hatch-jupyter-builder
This provides a build hook plugin for Hatch that adds a build step for use with Jupyter packages.
Table of Contents
Installation
pip install hatch-jupyter-builder
License
hatch-jupyter-builder
is distributed under the terms of the MIT license.
Usage and Configuration
The build hook plugin name is jupyter-builder
.
-
pyproject.toml
[tool.hatch.build.hooks.jupyter-builder] dependencies = ["hatch-jupyter-builder"] build-function = "hatch_jupyter_builder.npm_builder" ensured-targets = ["foo/generated.txt"] install-pre-commit-hook = true [tool.hatch.build.hooks.jupyter-builder.build-kwargs] build_cmd = "build:src"
Options
The only required fields are dependencies
and build-function
.
The build function is defined as an importable string with a module and a function name, separated by a period. The function must accept a
target_name
(either "wheel" or "sdist"), and a version
(either "standard" or "editable") as its only positional arguments. E.g.
-
builder.py
def build_func(target_name, version): ...
Would be defined as build-function = "builder.build_func"
The optional ensured-targets
is a list of expected file paths after building a
"standard" version sdist or wheel.
The optional build-kwargs
is a set of keyword arguments to pass to the build
function.
The optional install-pre-commit-hook
boolean causes a pre-commit
hook to be installed during an editable install.
Npm Builder Function
This library provides a convenenice npm_builder
function which can be
used to build npm
assets as part of the build.
Local Development
To test this package locally with another package, use the following:
[tool.hatch.build.hooks.jupyter-builder]
dependencies = ["hatch-jupyter-builder@file://<path_to_this_repo>"]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for hatch_jupyter_builder-0.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5f5c5281a3a35c236a6fa23b4111fbbac877c8f09e5fe2f9d52acb451a8760a |
|
MD5 | bf427e70c2a2c270582d2c222589bacf |
|
BLAKE2b-256 | 10954a818f11a3c0b8bea257e568812bd045e369cb89645e2c66975ef363e43f |
Hashes for hatch_jupyter_builder-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d36af47db7f4d34d55bd1e8ca24d338b76da6f86b3b359b60fa7bbba5ca543b4 |
|
MD5 | 24f34e197c5e312aef9eff3cdaf13139 |
|
BLAKE2b-256 | a067b23ce0b37dc7d054745e881ea69283cacc860525f9ec3b9fad22b9306722 |