1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 fetchFromGitHub,
6 pythonOlder,
7 substituteAll,
8 colorama,
9 contourpy,
10 jinja2,
11 numpy,
12 nodejs,
13 packaging,
14 pandas,
15 pillow,
16 tornado,
17 pytestCheckHook,
18 pyyaml,
19 setuptools,
20 xyzservices,
21 beautifulsoup4,
22 channels,
23 click,
24 colorcet,
25 coverage,
26 firefox,
27 geckodriver,
28 isort,
29 json5,
30 nbconvert,
31 networkx,
32 psutil,
33 pygments,
34 pygraphviz,
35 pytest,
36 pytest-asyncio,
37 pytest-xdist,
38 pytest-timeout,
39 requests,
40 scipy,
41 selenium,
42 toml,
43 typing-extensions,
44}:
45
46buildPythonPackage rec {
47 pname = "bokeh";
48 # update together with panel which is not straightforward
49 version = "3.6.0";
50 pyproject = true;
51
52 disabled = pythonOlder "3.9";
53
54 src = fetchPypi {
55 inherit pname version;
56 hash = "sha256-ADLcHnatCXsHYm5RWEaF/0jGVIH7qq0QVmOxBGFlhno=";
57 };
58
59 src_test = fetchFromGitHub {
60 owner = "bokeh";
61 repo = "bokeh";
62 rev = "refs/tags/${version}";
63 hash = "sha256-MAv+6bwc5f+jZasRDsYTJ/ir0i1pYCuwqPMumsYWvws=";
64 };
65
66 patches = [
67 (substituteAll {
68 src = ./hardcode-nodejs-npmjs-paths.patch;
69 node_bin = "${nodejs}/bin/node";
70 npm_bin = "${nodejs}/bin/npm";
71 })
72 ];
73
74 postPatch = ''
75 substituteInPlace pyproject.toml \
76 --replace-fail ', "setuptools-git-versioning"' "" \
77 --replace-fail 'dynamic = ["version"]' 'version = "${version}"'
78 '';
79
80 build-system = [
81 colorama
82 nodejs
83 setuptools
84 ];
85
86 nativeCheckInputs = [
87 pytestCheckHook
88 beautifulsoup4
89 channels
90 click
91 colorcet
92 coverage
93 firefox
94 geckodriver
95 isort
96 json5
97 nbconvert
98 networkx
99 psutil
100 pygments
101 pygraphviz
102 pytest
103 pytest-asyncio
104 pytest-xdist
105 pytest-timeout
106 requests
107 scipy
108 selenium
109 toml
110 typing-extensions
111 ];
112
113 dependencies = [
114 jinja2
115 contourpy
116 numpy
117 packaging
118 pandas
119 pillow
120 pyyaml
121 tornado
122 xyzservices
123 ];
124
125 doCheck = false; # need more work
126 pytestFlagsArray = "tests/test_defaults.py";
127 pythonImportsCheck = [ "bokeh" ];
128 preCheck = ''
129 cp -rv ''${src_test}/tests/* ./tests/
130 '';
131
132 meta = {
133 description = "Statistical and novel interactive HTML plots for Python";
134 mainProgram = "bokeh";
135 homepage = "https://github.com/bokeh/bokeh";
136 license = lib.licenses.bsd3;
137 maintainers = with lib.maintainers; [ orivej ];
138 };
139}