2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
pytestCheckHook,
|
|
|
|
pkg-config,
|
|
|
|
setuptools,
|
|
|
|
libjpeg,
|
|
|
|
libpng,
|
|
|
|
libtiff,
|
|
|
|
libwebp,
|
|
|
|
numpy,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2024-04-21 15:54:59 +00:00
|
|
|
pname = "imread";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0.7.6";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2024-09-19 14:19:46 +00:00
|
|
|
inherit pname version;
|
|
|
|
hash = "sha256-ULPXCJyGJQTCKyVu9R/kWFGzRhbbFMDr/FU2AByZYBU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libjpeg
|
|
|
|
libpng
|
|
|
|
libtiff
|
|
|
|
libwebp
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
dependencies = [ numpy ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
# verbose build outputs needed to debug hard-to-reproduce hydra failures
|
|
|
|
"-v"
|
2024-06-05 15:53:02 +00:00
|
|
|
"--pyargs"
|
2024-04-21 15:54:59 +00:00
|
|
|
"imread"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "imread" ];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
preCheck = ''
|
|
|
|
cd $TMPDIR
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
export OMP_NUM_THREADS=1
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python package to load images as numpy arrays";
|
2024-09-19 14:19:46 +00:00
|
|
|
homepage = "https://imread.readthedocs.io/";
|
|
|
|
changelog = "https://github.com/luispedro/imread/blob/v${version}/ChangeLog";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ luispedro ];
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|