summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/fslpy/default.nix
blob: c2815dc78e899a2ed19d4c31473ac3686300ed7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{
  lib,
  buildPythonPackage,
  fetchFromGitLab,
  setuptools,
  dill,
  h5py,
  nibabel,
  numpy,
  scipy,
  indexed-gzip,
  pillow,
  rtree,
  trimesh,
  wxpython,
  pytestCheckHook,
  pytest-cov-stub,
  tomli,
}:

buildPythonPackage rec {
  pname = "fslpy";
  version = "3.23.0";
  pyproject = true;

  src = fetchFromGitLab {
    domain = "git.fmrib.ox.ac.uk";
    owner = "fsl";
    repo = "fslpy";
    tag = version;
    hash = "sha256-lY/7TNOqGK0pRm5Rne1nrqXVQDZPkHwlZV9ITsOwp9Q=";
  };

  build-system = [ setuptools ];

  dependencies = [
    dill
    h5py
    nibabel
    numpy
    scipy
  ];

  optional-dependencies = {
    extra = [
      indexed-gzip
      pillow
      rtree
      trimesh
      wxpython
    ];
  };

  nativeCheckInputs = [
    pytestCheckHook
    pytest-cov-stub
    tomli
  ]
  ++ optional-dependencies.extra;

  disabledTestPaths = [
    # tries to download data:
    "fsl/tests/test_dicom.py"
    # tests exit with "SystemExit: Unable to access the X Display, is $DISPLAY set properly?"
    "fsl/tests/test_idle.py"
    "fsl/tests/test_platform.py"
    # require FSL's atlas library (via $FSLDIR), which has an unfree license:
    "fsl/tests/test_atlases.py"
    "fsl/tests/test_atlases_query.py"
    "fsl/tests/test_parse_data.py"
    "fsl/tests/test_scripts/test_atlasq_list_summary.py"
    "fsl/tests/test_scripts/test_atlasq_ohi.py"
    "fsl/tests/test_scripts/test_atlasq_query.py"
    # requires FSL (unfree and not in Nixpkgs):
    "fsl/tests/test_fslsub.py"
    "fsl/tests/test_run.py"
    "fsl/tests/test_wrappers"
  ];

  pythonImportsCheck = [
    "fsl"
    "fsl.data"
    "fsl.scripts"
    "fsl.transform"
    "fsl.utils"
    "fsl.wrappers"
  ];

  meta = {
    description = "FSL Python library";
    homepage = "https://git.fmrib.ox.ac.uk/fsl/fslpy";
    changelog = "https://git.fmrib.ox.ac.uk/fsl/fslpy/-/blob/main/CHANGELOG.rst";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ bcdarwin ];
  };
}