2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2018-10-16 22:18:40 +01:00
|
|
|
, buildPythonPackage
|
2020-06-26 05:53:19 +01:00
|
|
|
, isPy27
|
2019-02-21 08:40:41 +00:00
|
|
|
, pathlib
|
2018-11-04 17:32:33 +00:00
|
|
|
, fetchPypi
|
|
|
|
, pillow
|
|
|
|
, psutil
|
2019-02-21 08:40:41 +00:00
|
|
|
, imageio-ffmpeg
|
2018-10-16 22:18:40 +01:00
|
|
|
, pytest
|
|
|
|
, numpy
|
2018-11-04 17:32:33 +00:00
|
|
|
, isPy3k
|
2020-06-07 13:39:09 +01:00
|
|
|
, ffmpeg_3
|
2018-11-04 17:32:33 +00:00
|
|
|
, futures
|
|
|
|
, enum34
|
2018-10-16 22:18:40 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "imageio";
|
2020-08-16 18:31:03 +01:00
|
|
|
version = "2.9.0";
|
2020-06-26 05:53:19 +01:00
|
|
|
disabled = isPy27;
|
2018-10-16 22:18:40 +01:00
|
|
|
|
2018-11-04 17:32:33 +00:00
|
|
|
src = fetchPypi {
|
2020-08-16 18:31:03 +01:00
|
|
|
sha256 = "52ddbaeca2dccf53ba2d6dec5676ca7bc3b2403ef8b37f7da78b7654bb3e10f0";
|
2018-11-04 17:32:33 +00:00
|
|
|
inherit pname version;
|
2018-10-16 22:18:40 +01:00
|
|
|
};
|
|
|
|
|
2021-01-24 00:29:22 +00:00
|
|
|
checkInputs = [ pytest psutil ] ++ lib.optionals isPy3k [
|
2020-06-07 13:39:09 +01:00
|
|
|
imageio-ffmpeg ffmpeg_3
|
2019-02-21 08:40:41 +00:00
|
|
|
];
|
2020-06-26 05:53:19 +01:00
|
|
|
propagatedBuildInputs = [ numpy pillow ];
|
2018-10-16 22:18:40 +01:00
|
|
|
|
|
|
|
checkPhase = ''
|
2018-11-04 17:32:33 +00:00
|
|
|
export IMAGEIO_USERDIR="$TMP"
|
|
|
|
export IMAGEIO_NO_INTERNET="true"
|
|
|
|
export HOME="$(mktemp -d)"
|
2018-10-16 22:18:40 +01:00
|
|
|
py.test
|
|
|
|
'';
|
|
|
|
|
2018-11-04 17:32:33 +00:00
|
|
|
# For some reason, importing imageio also imports xml on Nix, see
|
|
|
|
# https://github.com/imageio/imageio/issues/395
|
2019-02-21 08:40:41 +00:00
|
|
|
|
|
|
|
# Also, there are tests that test the downloading of ffmpeg if it's not installed.
|
|
|
|
# "Uncomment" those by renaming.
|
2018-11-04 17:32:33 +00:00
|
|
|
postPatch = ''
|
2019-02-21 08:40:41 +00:00
|
|
|
substituteInPlace tests/test_meta.py --replace '"urllib",' "\"urllib\",\"xml\","
|
|
|
|
substituteInPlace tests/test_ffmpeg.py --replace 'test_get_exe_installed' 'get_exe_installed'
|
2018-11-04 17:32:33 +00:00
|
|
|
'';
|
2018-10-16 22:18:40 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-10-16 22:18:40 +01:00
|
|
|
description = "Library for reading and writing a wide range of image, video, scientific, and volumetric data formats";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://imageio.github.io/";
|
2018-10-16 22:18:40 +01:00
|
|
|
license = licenses.bsd2;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|