2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
pythonOlder,
|
|
|
|
hatchling,
|
|
|
|
ipywidgets,
|
|
|
|
numpy,
|
|
|
|
pillow,
|
2023-08-10 07:59:29 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ipycanvas";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0.13.3";
|
2024-05-15 15:35:15 +00:00
|
|
|
pyproject = true;
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-ToZ8UJsB9cTPwAn32SHjLloSoCmshW54wE/xW2VpLEo=";
|
2023-08-10 07:59:29 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# 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 \
|
2024-05-15 15:35:15 +00:00
|
|
|
--replace-fail '"jupyterlab>=3,<5",' "" \
|
2023-10-09 19:29:22 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ hatchling ];
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
env.HATCH_BUILD_NO_HOOKS = true;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
dependencies = [
|
|
|
|
ipywidgets
|
|
|
|
numpy
|
|
|
|
pillow
|
|
|
|
];
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
doCheck = false; # tests are in Typescript and require `npx` and `chromium`
|
2023-08-10 07:59:29 +00:00
|
|
|
pythonImportsCheck = [ "ipycanvas" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
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 = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
|
|
};
|
|
|
|
}
|