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
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
2023-11-16 04:20:00 +00:00
|
|
|
, fetchpatch
|
|
|
|
, 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";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.32.0";
|
|
|
|
pyproject = true;
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-5CWtNsYFMI2eptk+2nsJh5JgWbi4YiDhQqWZp5dRKN0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
patches = [
|
|
|
|
# pillow 10.1.0 compat
|
|
|
|
(fetchpatch {
|
|
|
|
name = "imageio-pillow-10.1.0-compat.patch";
|
|
|
|
url = "https://github.com/imageio/imageio/commit/f58379c1ae7fbd1da8689937b39e499e2d225740.patch";
|
|
|
|
hash = "sha256-jPSl/EUe69Dizkv8CqWpnm+TDPtF3VX2DkHOCEuYTLA=";
|
|
|
|
})
|
|
|
|
] ++ 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
|
|
|
];
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|