nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 mkDerivationWith,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # build-system
8 setuptools,
9 setuptools-scm,
10
11 # nativeBuildInputs
12 wrapQtAppsHook,
13
14 # dependencies
15 app-model,
16 appdirs,
17 cachey,
18 certifi,
19 dask,
20 docstring-parser,
21 imageio,
22 jsonschema,
23 magicgui,
24 napari-console,
25 napari-npe2,
26 napari-svg,
27 numpydoc,
28 pandas,
29 pillow,
30 pint,
31 psutil,
32 pydantic,
33 pyopengl,
34 pyyaml,
35 scikit-image,
36 scipy,
37 superqt,
38 tifffile,
39 toolz,
40 tqdm,
41 typing-extensions,
42 vispy,
43 wrapt,
44
45 # tests
46 hypothesis,
47 pretend,
48 pyautogui,
49 pytest-pretty,
50 pytest-qt,
51 pytestCheckHook,
52 writableTmpDirAsHomeHook,
53 xarray,
54 zarr,
55}:
56
57mkDerivationWith buildPythonPackage rec {
58 pname = "napari";
59 version = "0.6.6";
60 pyproject = true;
61
62 src = fetchFromGitHub {
63 owner = "napari";
64 repo = "napari";
65 tag = "v${version}";
66 hash = "sha256-F0l6GWyZ6n4HNZW7XyUk4ZBPQfrAW4DWixCaRHViDPI=";
67 };
68
69 postPatch = ''
70 substituteInPlace pyproject.toml \
71 --replace-fail '"--maxfail=5", ' ""
72 '';
73
74 build-system = [
75 setuptools
76 setuptools-scm
77 ];
78
79 nativeBuildInputs = [ wrapQtAppsHook ];
80
81 pythonRelaxDeps = [
82 "app-model"
83 "psygnal"
84 "vispy"
85 ];
86 dependencies = [
87 app-model
88 appdirs
89 cachey
90 certifi
91 dask
92 docstring-parser
93 imageio
94 jsonschema
95 magicgui
96 napari-console
97 napari-npe2
98 napari-svg
99 numpydoc
100 pandas
101 pillow
102 pint
103 psutil
104 pydantic
105 pyopengl
106 pyyaml
107 scikit-image
108 scipy
109 superqt
110 tifffile
111 toolz
112 tqdm
113 typing-extensions
114 vispy
115 wrapt
116 ]
117 ++ dask.optional-dependencies.array;
118
119 postFixup = ''
120 wrapQtApp $out/bin/napari
121 '';
122
123 preCheck = ''
124 rm src/napari/__init__.py
125 '';
126
127 nativeCheckInputs = [
128 hypothesis
129 pretend
130 pyautogui
131 pytest-pretty
132 pytest-qt
133 pytestCheckHook
134 writableTmpDirAsHomeHook
135 xarray
136 zarr
137 ];
138
139 disabledTestPaths = [
140 # Require DISPLAY access
141 "src/napari/_qt/"
142
143 # AttributeError: 'Selection' object has no attribute 'replace_selection'
144 "src/napari/layers/shapes/_tests/test_shapes.py"
145 "src/napari/layers/shapes/_tests/test_shapes_key_bindings.py"
146 "src/napari/layers/shapes/_tests/test_shapes_mouse_bindings.py"
147
148 # Fatal Python error: Aborted
149 "src/napari/_tests/test_adding_removing.py"
150 "src/napari/_tests/test_advanced.py"
151 "src/napari/_tests/test_cli.py"
152 "src/napari/_tests/test_conftest_fixtures.py"
153 "src/napari/_tests/test_function_widgets.py"
154 "src/napari/_tests/test_key_bindings.py"
155 "src/napari/_tests/test_layer_utils_with_qt.py"
156 "src/napari/_tests/test_mouse_bindings.py"
157 "src/napari/_tests/test_multiple_viewers.py"
158 "src/napari/_tests/test_notebook_display.py"
159 "src/napari/_tests/test_top_level_availability.py"
160 "src/napari/_tests/test_with_screenshot.py"
161 "src/napari/_vispy/"
162 ];
163
164 enabledTestPaths = [
165 "src/napari/_tests/"
166 ];
167
168 disabledTests = [
169 # Failed: DID NOT WARN. No warnings of type (<class 'FutureWarning'>,) were emitted.
170 "test_PublicOnlyProxy"
171
172 # NameError: name 'utils' is not defined
173 "test_create_func_deprecated"
174 "test_create_func_renamed"
175 "test_create_func"
176
177 # AttributeError: 'Selection' object has no attribute 'replace_selection'
178 "test_add_empty_shapes_layer"
179 "test_update_data_updates_layer_extent_cache"
180
181 # Fatal Python error: Aborted
182 "test_add_layer_data_to_viewer_optional"
183 "test_from_layer_data_tuple_accept_deprecating_dict"
184 "test_layers_populate_immediately"
185 "test_magicgui_add_data"
186 "test_magicgui_add_future_data"
187 "test_magicgui_add_layer"
188 "test_magicgui_add_layer_inheritance"
189 "test_magicgui_add_threadworker"
190 "test_magicgui_data_updated"
191 "test_magicgui_get_data"
192 "test_magicgui_get_viewer"
193 "test_make_napari_viewer"
194 "test_singlescreen_window_settings"
195 "test_sys_info"
196 "test_view"
197 ];
198
199 meta = {
200 description = "Fast, interactive, multi-dimensional image viewer";
201 homepage = "https://github.com/napari/napari";
202 changelog = "https://github.com/napari/napari/releases/tag/${src.tag}";
203 license = lib.licenses.bsd3;
204 maintainers = with lib.maintainers; [ SomeoneSerge ];
205 };
206}