b5f92a349c
GitOrigin-RevId: 7c9cc5a6e5d38010801741ac830a3f8fd667a7a0
60 lines
1.3 KiB
Nix
60 lines
1.3 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchPypi
|
|
, pytestCheckHook
|
|
, pythonOlder
|
|
, hatch-jupyter-builder
|
|
, hatchling
|
|
, importlib-metadata
|
|
, ipywidgets
|
|
, psygnal
|
|
, typing-extensions
|
|
, watchfiles
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "anywidget";
|
|
version = "0.7.0";
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-OxwCnCGvSwrVxBzQwxMBqESsETu2q1vdevJHDr/IfUI=";
|
|
};
|
|
|
|
# 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.*"' ""
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
hatch-jupyter-builder
|
|
hatchling
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
ipywidgets
|
|
psygnal
|
|
typing-extensions
|
|
] ++ lib.optional (pythonOlder "3.8") importlib-metadata;
|
|
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
watchfiles
|
|
];
|
|
|
|
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 ];
|
|
};
|
|
}
|