1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 yarnConfigHook,
7 fetchYarnDeps,
8 nodejs,
9
10 setuptools,
11
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 nest-asyncio,
23
24 celery,
25 redis,
26 diskcache,
27 multiprocess,
28 psutil,
29 flask-compress,
30
31 pytestCheckHook,
32 pytest-mock,
33 mock,
34 pyyaml,
35}:
36
37buildPythonPackage rec {
38 pname = "dash";
39 version = "3.0.4";
40 pyproject = true;
41
42 src = fetchFromGitHub {
43 owner = "plotly";
44 repo = "dash";
45 tag = "v${version}";
46 hash = "sha256-KCGVdD1L+U2KbktU2GU19BQ6wRcmEeYtC/v8UrFTyto=";
47 };
48
49 nativeBuildInputs = [
50 yarnConfigHook
51 nodejs
52 ];
53
54 yarnOfflineCache = fetchYarnDeps {
55 yarnLock = "${src}/@plotly/dash-jupyterlab/yarn.lock";
56 hash = "sha256-Nvm9BS55q/HW9ArpHD01F5Rmx8PLS3yqaz1yDK8Sg68=";
57 };
58
59 # as of writing this yarnConfigHook has no parameter that changes in which directory it will be run
60 # until then we use preConfigure for entering the directory and preBuild for exiting it
61 preConfigure = ''
62 pushd @plotly/dash-jupyterlab
63
64 substituteInPlace package.json \
65 --replace-fail 'jlpm' 'yarn'
66 '';
67
68 preBuild = ''
69 # Generate the jupyterlab extension files
70 yarn --offline run build:pack
71
72 popd
73 '';
74
75 build-system = [ setuptools ];
76
77 dependencies = [
78 flask
79 werkzeug
80 plotly
81 dash-html-components
82 dash-core-components
83 dash-table
84 importlib-metadata
85 typing-extensions
86 requests
87 retrying
88 nest-asyncio
89 ];
90
91 pythonRelaxDeps = [
92 "werkzeug"
93 "flask"
94 ];
95
96 optional-dependencies = {
97 celery = [
98 celery
99 redis
100 ];
101 diskcache = [
102 diskcache
103 multiprocess
104 psutil
105 ];
106 compress = [ flask-compress ];
107 };
108
109 nativeCheckInputs = [
110 pytestCheckHook
111 pytest-mock
112 mock
113 pyyaml
114 ];
115
116 disabledTestPaths = [
117 "tests/unit/test_browser.py"
118 "tests/unit/test_app_runners.py" # Uses selenium
119 "tests/integration"
120 ];
121
122 pythonImportsCheck = [ "dash" ];
123
124 meta = {
125 changelog = "https://github.com/plotly/dash/blob/${src.tag}/CHANGELOG.md";
126 description = "Python framework for building analytical web applications";
127 homepage = "https://dash.plot.ly/";
128 license = lib.licenses.mit;
129 maintainers = with lib.maintainers; [
130 antoinerg
131 tomasajt
132 ];
133 };
134}