python311Packages.imread: Fix testing

Use pytestCheckHook to fix tests

As per suggestions on PR from @dotlambda, switched to `pyproject=true`
and `hash` and reformatted the package.

closes #293191
This commit is contained in:
Luis Pedro Coelho
2024-03-05 15:58:40 +10:00
parent 788f65a3d7
commit 2a67612019
@@ -1,8 +1,9 @@
{ lib
, buildPythonPackage
, fetchPypi
, nose
, pytestCheckHook
, pkg-config
, setuptools
, libjpeg
, libpng
, libtiff
@@ -13,18 +14,48 @@
buildPythonPackage rec {
pname = "python-imread";
version = "0.7.5";
pyproject = true;
src = fetchPypi {
inherit version;
pname = "imread";
sha256 = "sha256-GiWpA128GuLlbBW1CQQHHVVeoZfu9Yyh2RFzSdtHDbc=";
hash = "sha256-GiWpA128GuLlbBW1CQQHHVVeoZfu9Yyh2RFzSdtHDbc=";
};
nativeBuildInputs = [
pkg-config
setuptools
];
buildInputs = [
libjpeg
libpng
libtiff
libwebp
];
nativeBuildInputs = [ pkg-config ];
buildInputs = [ nose 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/";