2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2022-04-15 01:41:22 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2022-10-21 18:38:19 +00:00
|
|
|
, pythonOlder
|
2024-01-02 11:29:13 +00:00
|
|
|
, fetchFromGitHub
|
2023-11-16 04:20:00 +00:00
|
|
|
, isPyPy
|
2022-04-15 01:41:22 +00:00
|
|
|
, substituteAll
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
# build-system
|
|
|
|
, setuptools
|
|
|
|
|
|
|
|
# native dependencies
|
|
|
|
, libGL
|
|
|
|
|
|
|
|
# dependencies
|
2020-04-24 23:36:52 +00:00
|
|
|
, numpy
|
2021-05-20 23:08:51 +00:00
|
|
|
, pillow
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
# optional-dependencies
|
|
|
|
, astropy
|
|
|
|
, av
|
|
|
|
, imageio-ffmpeg
|
|
|
|
, pillow-heif
|
2021-05-20 23:08:51 +00:00
|
|
|
, psutil
|
2021-12-26 17:43:05 +00:00
|
|
|
, tifffile
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
# tests
|
|
|
|
, pytestCheckHook
|
2022-04-15 01:41:22 +00:00
|
|
|
, fsspec
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "imageio";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "2.34.0";
|
2023-11-16 04:20:00 +00:00
|
|
|
pyproject = true;
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "imageio";
|
|
|
|
repo = "imageio";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-+I5KmKSLi8ARbDH06em71LWhmqziAaDfaBp4hU67/jg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
patches = lib.optionals (!stdenv.isDarwin) [
|
2022-04-15 01:41:22 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = ./libgl-path.patch;
|
|
|
|
libgl = "${libGL.out}/lib/libGL${stdenv.hostPlatform.extensions.sharedLibrary}";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
pillow
|
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
bsdf = [];
|
|
|
|
dicom = [];
|
|
|
|
feisem = [];
|
|
|
|
ffmpeg = [
|
|
|
|
imageio-ffmpeg
|
|
|
|
psutil
|
|
|
|
];
|
|
|
|
fits = lib.optionals (!isPyPy) [
|
|
|
|
astropy
|
|
|
|
];
|
|
|
|
freeimage = [];
|
|
|
|
lytro = [];
|
|
|
|
numpy = [];
|
|
|
|
pillow = [];
|
|
|
|
simpleitk = [];
|
|
|
|
spe = [];
|
|
|
|
swf = [];
|
|
|
|
tifffile = [
|
|
|
|
tifffile
|
|
|
|
];
|
|
|
|
pyav = [
|
|
|
|
av
|
|
|
|
];
|
|
|
|
heif = [
|
|
|
|
pillow-heif
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-04-15 01:41:22 +00:00
|
|
|
fsspec
|
2021-05-20 23:08:51 +00:00
|
|
|
psutil
|
|
|
|
pytestCheckHook
|
2023-11-16 04:20:00 +00:00
|
|
|
]
|
|
|
|
++ fsspec.optional-dependencies.github
|
|
|
|
++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"-m 'not needs_internet'"
|
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
preCheck = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
export IMAGEIO_USERDIR="$TMP"
|
2022-04-15 01:41:22 +00:00
|
|
|
export HOME=$TMPDIR
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
disabledTestPaths = [
|
2022-04-15 01:41:22 +00:00
|
|
|
# tries to fetch fixtures over the network
|
|
|
|
"tests/test_freeimage.py"
|
2021-12-26 17:43:05 +00:00
|
|
|
"tests/test_pillow.py"
|
2022-04-15 01:41:22 +00:00
|
|
|
"tests/test_spe.py"
|
|
|
|
"tests/test_swf.py"
|
2021-12-26 17:43:05 +00:00
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabledTests = lib.optionals stdenv.isDarwin [
|
|
|
|
# Segmentation fault
|
|
|
|
"test_bayer_write"
|
|
|
|
# RuntimeError: No valid H.264 encoder was found with the ffmpeg installation
|
|
|
|
"test_writer_file_properly_closed"
|
|
|
|
"test_writer_pixelformat_size_verbose"
|
|
|
|
"test_writer_ffmpeg_params"
|
|
|
|
"test_reverse_read"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Library for reading and writing a wide range of image, video, scientific, and volumetric data formats";
|
2023-05-24 13:37:59 +00:00
|
|
|
homepage = "https://imageio.readthedocs.io";
|
|
|
|
changelog = "https://github.com/imageio/imageio/blob/v${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd2;
|
2022-09-30 11:47:45 +00:00
|
|
|
maintainers = with maintainers; [ Luflosi ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|