Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / anywidget / default.nix
blob25aa924491057e8bfb17a71e5ea59a4876723fe4
1 { lib
2 , buildPythonPackage
3 , fetchPypi
4 , pytestCheckHook
5 , pythonOlder
6 , hatch-jupyter-builder
7 , hatchling
8 , importlib-metadata
9 , ipywidgets
10 , psygnal
11 , typing-extensions
12 , watchfiles
15 buildPythonPackage rec {
16   pname = "anywidget";
17   version = "0.7.1";
18   format = "pyproject";
20   disabled = pythonOlder "3.7";
22   src = fetchPypi {
23     inherit pname version;
24     hash = "sha256-HEy1EGP47FFyuMjvsb+3mGHTQMNJEiDVa4wqaqjbOz0=";
25   };
27   # We do not need the jupyterlab build dependency, because we do not need to
28   # build any JS components; these are present already in the PyPI artifact.
29   #
30   postPatch = ''
31     substituteInPlace pyproject.toml \
32       --replace '"jupyterlab==3.*"' ""
33   '';
35   nativeBuildInputs = [
36     hatch-jupyter-builder
37     hatchling
38   ];
40   propagatedBuildInputs = [
41     ipywidgets
42     psygnal
43     typing-extensions
44   ] ++ lib.optional (pythonOlder "3.8") importlib-metadata;
46   nativeCheckInputs = [
47     pytestCheckHook
48     watchfiles
49   ];
51   pythonImportsCheck = [ "anywidget" ];
53   meta = with lib; {
54     description = "Custom jupyter widgets made easy";
55     homepage = "https://github.com/manzt/anywidget";
56     changelog = "https://github.com/manzt/anywidget/releases/tag/anywidget%40${version}";
57     license = licenses.mit;
58     maintainers = with maintainers; [ natsukium ];
59   };