nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 hatchling,
8 hatch-vcs,
9
10 # dependencies
11 build,
12 platformdirs,
13 psygnal,
14 pydantic,
15 pydantic-extra-types,
16 pyyaml,
17 rich,
18 tomli-w,
19 typer,
20
21 # tests
22 imagemagick,
23 jsonschema,
24 magicgui,
25 napari-plugin-engine,
26 numpy,
27 pytest-pretty,
28 pytestCheckHook,
29
30 # passthru
31 napari, # reverse dependency, for tests
32}:
33
34buildPythonPackage (finalAttrs: {
35 pname = "napari-npe2";
36 version = "0.8.0";
37 pyproject = true;
38
39 src = fetchFromGitHub {
40 owner = "napari";
41 repo = "npe2";
42 tag = "v${finalAttrs.version}";
43 hash = "sha256-aZOs9wTYcblt9EZftYHKFWI/GvpZcC2KqVTAis15+Iw=";
44 };
45
46 build-system = [
47 hatchling
48 hatch-vcs
49 ];
50
51 dependencies = [
52 build
53 platformdirs
54 psygnal
55 pydantic
56 pydantic-extra-types
57 pyyaml
58 rich
59 tomli-w
60 typer
61 ];
62
63 pythonImportsCheck = [ "npe2" ];
64
65 nativeCheckInputs = [
66 imagemagick
67 jsonschema
68 magicgui
69 napari-plugin-engine
70 numpy
71 pytest-pretty
72 pytestCheckHook
73 ];
74
75 disabledTests = [
76 # Require internet connection
77 "test_cli_fetch"
78 "test_fetch_npe1_manifest_dock_widget_as_attribute"
79 "test_fetch_npe1_manifest_with_sample_data"
80 "test_fetch_npe2_manifest"
81 "test_get_manifest_from_wheel"
82 "test_get_pypi_url"
83
84 # No package or entry point found with name 'svg'
85 "test_cli_convert_svg"
86 "test_conversion"
87 ];
88
89 passthru.tests = {
90 inherit napari;
91 };
92
93 meta = {
94 description = "Plugin system for napari (the image visualizer)";
95 homepage = "https://github.com/napari/npe2";
96 changelog = "https://github.com/napari/npe2/releases/tag/${finalAttrs.src.tag}";
97 license = lib.licenses.bsd3;
98 maintainers = with lib.maintainers; [ SomeoneSerge ];
99 mainProgram = "npe2";
100 };
101})