summary refs log tree commit diff
path: root/pkgs/development/python-modules/pymedio/default.nix
blob: bf220a4dc2480c487315c03eee6d4a73df4fad61 (plain) (blame)
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
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, pytestCheckHook
, cryptography
, nibabel
, numpy
, pydicom
, simpleitk
}:

buildPythonPackage rec {
  pname = "pymedio";
  version = "0.2.13";
  disabled = pythonOlder "3.9";

  src = fetchFromGitHub {
    owner = "jcreinhold";
    repo = "pymedio";
    rev = "refs/tags/v${version}";
    hash = "sha256-iHbClOrtYkHT1Nar+5j/ig4Krya8LdQdFB4Mmm5B9bg=";
  };

  # relax Python dep to work with 3.10.x and 3.11.x
  postPatch = ''
    substituteInPlace setup.cfg --replace "!=3.10.*," "" --replace "!=3.11.*" ""
  '';

  propagatedBuildInputs = [ numpy ];

  nativeCheckInputs = [
    pytestCheckHook
    cryptography
    nibabel
    pydicom
    simpleitk
  ];

  pythonImportsCheck = [
    "pymedio"
  ];

  meta = with lib; {
    description = "Read medical image files into Numpy arrays";
    homepage = "https://github.com/jcreinhold/pymedio";
    license = licenses.mit;
    maintainers = with maintainers; [ bcdarwin ];
  };
}