1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5
6, nodejs
7, yarn
8, fixup_yarn_lock
9, fetchYarnDeps
10
11, setuptools
12, flask
13, werkzeug
14, plotly
15, dash-html-components
16, dash-core-components
17, dash-table
18, importlib-metadata
19, typing-extensions
20, requests
21, retrying
22, ansi2html
23, nest-asyncio
24
25, celery
26, redis
27, diskcache
28, multiprocess
29, psutil
30, flask-compress
31
32, pytestCheckHook
33, pytest-mock
34, mock
35, pyyaml
36}:
37
38buildPythonPackage rec {
39 pname = "dash";
40 version = "2.14.1";
41 format = "setuptools";
42
43 disabled = pythonOlder "3.6";
44
45 src = fetchFromGitHub {
46 owner = "plotly";
47 repo = pname;
48 rev = "refs/tags/v${version}";
49 hash = "sha256-vQOfX9RCIbr5lfUyT2knwrO374/vm7jH+/1+BeqmRjI=";
50 };
51
52 nativeBuildInputs = [
53 nodejs
54 yarn
55 fixup_yarn_lock
56 ];
57
58 yarnDeps = fetchYarnDeps {
59 yarnLock = src + "/@plotly/dash-jupyterlab/yarn.lock";
60 hash = "sha256-mkiyrA0jGiP0zbabSjgHFLEUX3f+LZdJ8eARI5QA8CU=";
61 };
62
63 preBuild = ''
64 pushd @plotly/dash-jupyterlab
65
66 export HOME=$(mktemp -d)
67
68 yarn config --offline set yarn-offline-mirror ${yarnDeps}
69 fixup_yarn_lock yarn.lock
70
71 substituteInPlace package.json --replace jlpm yarn
72 yarn install --offline --frozen-lockfile --ignore-engines --ignore-scripts
73 patchShebangs .
74
75 # Generates the jupyterlab extension files
76 yarn run build:pack
77
78 popd
79 '';
80
81 propagatedBuildInputs = [
82 setuptools # for importing pkg_resources
83 flask
84 werkzeug
85 plotly
86 dash-html-components
87 dash-core-components
88 dash-table
89 importlib-metadata
90 typing-extensions
91 requests
92 retrying
93 ansi2html
94 nest-asyncio
95 ];
96
97 passthru.optional-dependencies = {
98 celery = [
99 celery
100 redis
101 ];
102 diskcache = [
103 diskcache
104 multiprocess
105 psutil
106 ];
107 compress = [
108 flask-compress
109 ];
110 };
111
112 nativeCheckInputs = [
113 pytestCheckHook
114 pytest-mock
115 mock
116 pyyaml
117 ];
118
119 disabledTestPaths = [
120 "tests/unit/test_browser.py"
121 "tests/unit/test_app_runners.py" # Uses selenium
122 "tests/integration"
123 ];
124
125 pythonImportsCheck = [ "dash" ];
126
127 meta = {
128 description = "Python framework for building analytical web applications";
129 homepage = "https://dash.plot.ly/";
130 changelog = "https://github.com/plotly/dash/blob/${src.rev}/CHANGELOG.md";
131 license = lib.licenses.mit;
132 maintainers = with lib.maintainers; [ antoinerg tomasajt ];
133 };
134}