2018-10-16 22:18:40 +01:00
|
|
|
{ stdenv
|
|
|
|
, buildPythonPackage
|
2018-11-04 17:32:33 +00:00
|
|
|
, fetchPypi
|
|
|
|
, pillow
|
|
|
|
, psutil
|
2018-10-16 22:18:40 +01:00
|
|
|
, pytest
|
|
|
|
, numpy
|
2018-11-04 17:32:33 +00:00
|
|
|
, isPy3k
|
|
|
|
, futures
|
|
|
|
, enum34
|
2018-10-16 22:18:40 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "imageio";
|
2018-11-04 17:32:33 +00:00
|
|
|
version = "2.4.1";
|
2018-10-16 22:18:40 +01:00
|
|
|
|
2018-11-04 17:32:33 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
sha256 = "0jjiwf6wjipmykh33prjh448qv8mpgngfi77ndc7mym5r1xhgf0n";
|
|
|
|
inherit pname version;
|
2018-10-16 22:18:40 +01:00
|
|
|
};
|
|
|
|
|
2018-11-04 17:32:33 +00:00
|
|
|
checkInputs = [ pytest psutil ];
|
|
|
|
propagatedBuildInputs = [ numpy pillow ] ++ stdenv.lib.optionals (!isPy3k) [
|
|
|
|
futures
|
|
|
|
enum34
|
|
|
|
];
|
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
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tests/test_meta.py --replace '"urllib",' "\"urllib\",\"xml\""
|
|
|
|
'';
|
2018-10-16 22:18:40 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Library for reading and writing a wide range of image, video, scientific, and volumetric data formats";
|
|
|
|
homepage = http://imageio.github.io/;
|
|
|
|
license = licenses.bsd2;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|