Files
nixpkgs/pkgs/development/python-modules/imread/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

64 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
pytestCheckHook,
pkg-config,
setuptools,
libjpeg,
libpng,
libtiff,
libwebp,
numpy,
}:
buildPythonPackage rec {
pname = "imread";
version = "0.7.6";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-ULPXCJyGJQTCKyVu9R/kWFGzRhbbFMDr/FU2AByZYBU=";
};
build-system = [ setuptools ];
nativeBuildInputs = [ pkg-config ];
buildInputs = [
libjpeg
libpng
libtiff
libwebp
];
dependencies = [ numpy ];
nativeCheckInputs = [ pytestCheckHook ];
pytestFlags = [
# 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 = {
description = "Python package to load images as numpy arrays";
homepage = "https://imread.readthedocs.io/";
changelog = "https://github.com/luispedro/imread/blob/v${version}/ChangeLog";
maintainers = with lib.maintainers; [ luispedro ];
license = lib.licenses.mit;
platforms = lib.platforms.unix;
};
}