2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
hatch-jupyter-builder,
|
|
|
|
hatchling,
|
|
|
|
importlib-metadata,
|
|
|
|
ipywidgets,
|
|
|
|
psygnal,
|
|
|
|
typing-extensions,
|
|
|
|
watchfiles,
|
2023-08-22 20:05:09 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "anywidget";
|
2024-07-01 15:47:52 +00:00
|
|
|
version = "0.9.13";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2023-08-22 20:05:09 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-07-01 15:47:52 +00:00
|
|
|
hash = "sha256-xlVFW/UfghgusjxZR9N8xB8LH/rK9+K3YxR6IzLLPwc=";
|
2023-08-22 20:05:09 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# We do not need the jupyterlab build dependency, because we do not need to
|
|
|
|
# build any JS components; these are present already in the PyPI artifact.
|
|
|
|
#
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace '"jupyterlab==3.*"' ""
|
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [
|
2023-08-22 20:05:09 +00:00
|
|
|
hatch-jupyter-builder
|
|
|
|
hatchling
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2023-08-22 20:05:09 +00:00
|
|
|
ipywidgets
|
|
|
|
psygnal
|
|
|
|
typing-extensions
|
|
|
|
] ++ lib.optional (pythonOlder "3.8") importlib-metadata;
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
watchfiles
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTests = [
|
|
|
|
# requires package.json
|
|
|
|
"test_version"
|
|
|
|
];
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
pythonImportsCheck = [ "anywidget" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Custom jupyter widgets made easy";
|
|
|
|
homepage = "https://github.com/manzt/anywidget";
|
|
|
|
changelog = "https://github.com/manzt/anywidget/releases/tag/anywidget%40${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ natsukium ];
|
|
|
|
};
|
|
|
|
}
|