Files
nixpkgs/pkgs/development/python-modules/ipycanvas/default.nix
2026-03-27 23:08:41 +00:00

63 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
hatch,
hatch-build-scripts,
hatch-nodejs-version,
hatchling,
jupyterlab,
# dependencies
ipywidgets,
numpy,
pillow,
}:
buildPythonPackage (finalAttrs: {
pname = "ipycanvas";
version = "0.14.3";
pyproject = true;
src = fetchFromGitHub {
owner = "jupyter-widgets-contrib";
repo = "ipycanvas";
tag = "v${finalAttrs.version}";
hash = "sha256-VvNCe3+zK3qSuYErO4H2UlfAClvfDmisExWHx48cjUo=";
};
# _version.py is supposed to be generated by a script
postPatch = ''
echo '__version__ = "{${finalAttrs.version}}"' > ipycanvas/_version.py
'';
build-system = [
hatch
hatch-build-scripts
hatch-nodejs-version
hatchling
jupyterlab
];
env.HATCH_BUILD_NO_HOOKS = true;
dependencies = [
ipywidgets
numpy
pillow
];
doCheck = false; # tests are in Typescript and require `npx` and `chromium`
pythonImportsCheck = [ "ipycanvas" ];
meta = {
description = "Expose the browser's Canvas API to IPython";
homepage = "https://ipycanvas.readthedocs.io";
changelog = "https://github.com/jupyter-widgets-contrib/ipycanvas/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ bcdarwin ];
};
})