1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 hatchling,
6 hatch-vcs,
7 pythonOlder,
8 pyyaml,
9 platformdirs,
10 build,
11 psygnal,
12 pydantic,
13 tomli-w,
14 tomli,
15 rich,
16 typer,
17 napari, # reverse dependency, for tests
18}:
19
20buildPythonPackage rec {
21 pname = "napari-npe2";
22 version = "0.7.9";
23 pyproject = true;
24
25 disabled = pythonOlder "3.8";
26
27 src = fetchFromGitHub {
28 owner = "napari";
29 repo = "npe2";
30 tag = "v${version}";
31 hash = "sha256-q+vgzUuSSHFR64OajT/j/tLsNgSm3azQPCvDlrIvceM=";
32 };
33
34 build-system = [
35 hatchling
36 hatch-vcs
37 ];
38
39 dependencies = [
40 pyyaml
41 platformdirs
42 build
43 psygnal
44 pydantic
45 tomli-w
46 rich
47 typer
48 ]
49 ++ lib.optionals (pythonOlder "3.11") [
50 tomli
51 ];
52
53 pythonImportsCheck = [ "npe2" ];
54
55 passthru.tests = {
56 inherit napari;
57 };
58
59 meta = {
60 description = "Plugin system for napari (the image visualizer)";
61 homepage = "https://github.com/napari/npe2";
62 license = lib.licenses.bsd3;
63 maintainers = with lib.maintainers; [ SomeoneSerge ];
64 mainProgram = "npe2";
65 };
66}