Files
nixpkgs/pkgs/development/python-modules/rawpy/default.nix
Lin Xianyi 220ec9effe python3Packages.rawpy: fix build
Fixes build due to failing test
2025-08-26 20:03:49 +08:00

92 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
cython,
setuptools,
# nativeBuildInputs
pkg-config,
# buildInputs
libraw,
# dependencies
numpy,
# tests
imageio,
pytestCheckHook,
scikit-image,
}:
buildPythonPackage rec {
pname = "rawpy";
version = "0.25.1";
pyproject = true;
src = fetchFromGitHub {
owner = "letmaik";
repo = "rawpy";
tag = "v${version}";
hash = "sha256-d3TxPW3GdCQT8bBbnveSxtWHkf5zinM8nSy4m/P7m7Q=";
};
build-system = [
cython
numpy
setuptools
];
nativeBuildInputs = [
pkg-config
];
buildInputs = [
libraw
];
dependencies = [
numpy
];
env = {
RAWPY_USE_SYSTEM_LIBRAW = 1;
};
pythonImportsCheck = [
"rawpy"
"rawpy._rawpy"
];
# Delete the source files to load the library from the installed folder instead of the source files
preCheck = ''
rm -rf rawpy
'';
nativeCheckInputs = [
imageio
pytestCheckHook
scikit-image
];
disabledTests = [
# rawpy._rawpy.LibRawFileUnsupportedError: b'Unsupported file format or not RAW file'
"testCropSizeSigma"
"testFoveonFileOpenAndPostProcess"
"testThumbExtractBitmap"
];
meta = {
description = "RAW image processing for Python, a wrapper for libraw";
homepage = "https://github.com/letmaik/rawpy";
license = with lib.licenses; [
lgpl21Only
mit
];
maintainers = with lib.maintainers; [ GaetanLepage ];
};
}