Files
nixpkgs/pkgs/development/python-modules/ipycanvas/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

54 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
pythonOlder,
hatchling,
ipywidgets,
numpy,
pillow,
}:
buildPythonPackage rec {
pname = "ipycanvas";
version = "0.14.2";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-OFNwRHcRlN2jFjbEEHh4RxZyp6y1hLfotRgrIpsXBtU=";
};
# We relax dependencies here instead of pulling in a patch because upstream
# has released a new version using hatch-jupyter-builder, but it is not yet
# trivial to upgrade to that.
#
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail '"jupyterlab>=3,<5",' "" \
'';
build-system = [ hatchling ];
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/${version}";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ bcdarwin ];
};
}