depot/third_party/nixpkgs/pkgs/development/python-modules/anywidget/default.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

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.9.10";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-OQpigkCYHAmBPHUjJ53cq4L/T9Moet1UM7eLE2kIkGg=";
};
# 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.*"' ""
'';
build-system = [
hatch-jupyter-builder
hatchling
];
dependencies = [
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 ];
};
}