
This treewide change targets Python packages that specifies pytest flags with pytestFlagsArray, and whose flags cannot be consructed by other pytestCheckHook-honoured arguments. Use the __structuredAttrs-agnostic argument pytestFlags instead of the deprecated pytestFlagsArray. For flags with option arguments, join each flag and their option argument into a single command-line argument following POSIX Utility Argument Syntax[1] for easier overriding (remove/replace). Examples: * [ "-W" "ignore:message:WarningClass" ] -> [ "-Wignore:message:WarningClass" ] * [ "--reruns" "3" ] -> [ "--reruns=3" ] [1]: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html
64 lines
1.1 KiB
Nix
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 = with lib; {
|
|
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 maintainers; [ luispedro ];
|
|
license = licenses.mit;
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|