nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # frontend
7 nodejs,
8 yarn-berry_3,
9
10 # build-system
11 hatch-jupyter-builder,
12 hatch-nodejs-version,
13 hatchling,
14 jupyterlab,
15
16 # dependencies
17 ipython,
18 ipywidgets,
19 matplotlib,
20 numpy,
21 pillow,
22 traitlets,
23
24 # tests
25 importlib-metadata,
26 nbval,
27 pytestCheckHook,
28}:
29
30buildPythonPackage (finalAttrs: {
31 pname = "ipympl";
32 version = "0.10.0";
33 pyproject = true;
34
35 src = fetchFromGitHub {
36 owner = "matplotlib";
37 repo = "ipympl";
38 tag = "v${finalAttrs.version}";
39 hash = "sha256-IJ7tLUE0Ac4biQc9b87adgDcD8pa9XH1bo8rzDl9DCY=";
40 };
41
42 yarnOfflineCache = yarn-berry_3.fetchYarnBerryDeps {
43 inherit (finalAttrs) src;
44 hash = "sha256-tdfrAf2BSz9n83ctWqRxDHZnhnfhKA3BFNhXVr9wvLY=";
45 };
46
47 nativeBuildInputs = [
48 nodejs
49 yarn-berry_3.yarnBerryConfigHook
50 ];
51
52 build-system = [
53 hatch-jupyter-builder
54 hatch-nodejs-version
55 hatchling
56 jupyterlab
57 ];
58
59 dependencies = [
60 ipython
61 ipywidgets
62 matplotlib
63 numpy
64 pillow
65 traitlets
66 ];
67
68 nativeCheckInputs = [
69 importlib-metadata
70 nbval
71 pytestCheckHook
72 ];
73
74 pythonImportsCheck = [
75 "ipympl"
76 "ipympl.backend_nbagg"
77 ];
78
79 meta = {
80 changelog = "https://github.com/matplotlib/ipympl/releases/tag/${finalAttrs.src.tag}";
81 description = "Matplotlib Jupyter Extension";
82 homepage = "https://github.com/matplotlib/jupyter-matplotlib";
83 maintainers = with lib.maintainers; [
84 jluttine
85 fabiangd
86 ];
87 license = lib.licenses.bsd3;
88 };
89})