depot/third_party/nixpkgs/pkgs/development/python-modules/imread/default.nix
Default email 587713944a Project import generated by Copybara.
GitOrigin-RevId: 6143fc5eeb9c4f00163267708e26191d1e918932
2024-04-21 17:54:59 +02:00

67 lines
1.1 KiB
Nix

{ 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;
};
}