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 = "2.18.1";
40 pyproject = true;
41
42 src = fetchFromGitHub {
43 owner = "plotly";
44 repo = "dash";
45 rev = "refs/tags/v${version}";
46 hash = "sha256-2LwM1lrJNdekoDN+wDHgaSlGOnpK618r65UHj7cP59E=";
47 };
48
49 nativeBuildInputs = [
50 yarnConfigHook
51 nodejs
52 ];
53
54 yarnOfflineCache = fetchYarnDeps {
55 yarnLock = "${src}/@plotly/dash-jupyterlab/yarn.lock";
56 hash = "sha256-L/or8jO6uEypI5krwy/ElIxa6jJrXGsCRZ9mh+0kcGA=";
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 optional-dependencies = {
92 celery = [
93 celery
94 redis
95 ];
96 diskcache = [
97 diskcache
98 multiprocess
99 psutil
100 ];
101 compress = [ flask-compress ];
102 };
103
104 nativeCheckInputs = [
105 pytestCheckHook
106 pytest-mock
107 mock
108 pyyaml
109 ];
110
111 disabledTestPaths = [
112 "tests/unit/test_browser.py"
113 "tests/unit/test_app_runners.py" # Uses selenium
114 "tests/integration"
115 ];
116
117 pythonImportsCheck = [ "dash" ];
118
119 meta = {
120 changelog = "https://github.com/plotly/dash/blob/${src.rev}/CHANGELOG.md";
121 description = "Python framework for building analytical web applications";
122 homepage = "https://dash.plot.ly/";
123 license = lib.licenses.mit;
124 maintainers = with lib.maintainers; [
125 antoinerg
126 tomasajt
127 ];
128 };
129}