1{ lib
2, buildPythonPackage
3, fetchPypi
4, bleach
5, bokeh
6, param
7, pyviz-comms
8, markdown
9, pyct
10, testpath
11, tqdm
12, callPackage
13}:
14
15let
16 node = callPackage ./node { };
17in
18buildPythonPackage rec {
19 pname = "panel";
20 version = "0.12.1";
21
22 # Don't forget to also update the node packages
23 # 1. retrieve the package.json file
24 # 2. nix shell nixpkgs#nodePackages.node2nix
25 # 3. node2nix
26 src = fetchPypi {
27 inherit pname version;
28 sha256 = "e4898d60abdb82f8a429df7f59dbf8bcaf7e19b3e633555512ceb4ce06678458";
29 };
30
31 # Since 0.10.0 panel attempts to fetch from the web.
32 # We avoid this:
33 # - we use node2nix to fetch assets
34 # - we disable bundling (which also tries to fetch assets)
35 # Downside of disabling bundling is that in an airgapped environment
36 # one may miss assets.
37 # https://github.com/holoviz/panel/issues/1819
38 preBuild = ''
39 substituteInPlace setup.py --replace "bundle_resources()" ""
40 pushd panel
41 ln -s ${node.nodeDependencies}/lib/node_modules
42 export PATH="${node.nodeDependencies}/bin:$PATH"
43 popd
44 '';
45
46 propagatedBuildInputs = [
47 bleach
48 bokeh
49 param
50 pyviz-comms
51 markdown
52 pyct
53 testpath
54 tqdm
55 ];
56
57 # infinite recursion in test dependencies (hvplot)
58 doCheck = false;
59
60 passthru = {
61 inherit node; # For convenience
62 };
63
64 meta = with lib; {
65 description = "A high level dashboarding library for python visualization libraries";
66 homepage = "https://pyviz.org";
67 license = licenses.bsd3;
68 maintainers = [ maintainers.costrouc ];
69 };
70}