about summary refs log tree commit diff
path: root/pkgs/development/python-modules/imread/default.nix
blob: 8d2823356e32a34e30e5e4c0c4df55aa34b46c7e (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ lib
, buildPythonPackage
, fetchPypi
, pytestCheckHook
, pkg-config
, setuptools
, libjpeg
, libpng
, libtiff
, libwebp
, numpy
}:

buildPythonPackage rec {
  pname = "imread";
  version = "0.7.5";
  pyproject = true;

  src = fetchPypi {
    inherit version;
    pname = "imread";
    hash = "sha256-GiWpA128GuLlbBW1CQQHHVVeoZfu9Yyh2RFzSdtHDbc=";
  };

  nativeBuildInputs = [
    pkg-config
    setuptools
  ];

  buildInputs = [
    libjpeg
    libpng
    libtiff
    libwebp
  ];

  propagatedBuildInputs = [ numpy ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  pytestFlagsArray = [
    # verbose build outputs needed to debug hard-to-reproduce hydra failures
    "-v"
    "--pyargs" "imread"
  ];

  pythonImportsCheck = [
    "imread"
  ];

  preCheck = ''
    cd $TMPDIR
    export HOME=$TMPDIR
    export OMP_NUM_THREADS=1
  '';

  meta = with lib; {
    description = "Python package to load images as numpy arrays";
    homepage = "https://imread.readthedocs.io/en/latest/";
    maintainers = with maintainers; [ luispedro ];
    license = licenses.mit;
    platforms = platforms.unix;
  };

}