1{ lib
2, fetchPypi
3, buildPythonPackage
4, isPy27
5, isPy3k
6, numpy
7, imagecodecs-lite
8, enum34 ? null
9, futures ? null
10, pathlib ? null
11, pytest
12}:
13
14buildPythonPackage rec {
15 pname = "tifffile";
16 version = "2021.8.30";
17
18 src = fetchPypi {
19 inherit pname version;
20 sha256 = "8760e61e30106ea0dab9ec42a238d70a3ff55dde9c54456e7b748fe717cb782d";
21 };
22
23 patches = lib.optional isPy27 ./python2-regex-compat.patch;
24
25 # Missing dependencies: imagecodecs, czifile, cmapfile, oiffile, lfdfiles
26 # and test data missing from PyPI tarball
27 doCheck = false;
28
29 checkInputs = [
30 pytest
31 ];
32
33 checkPhase = ''
34 pytest
35 '';
36
37 propagatedBuildInputs = [
38 numpy
39 ] ++ lib.optionals isPy3k [
40 imagecodecs-lite
41 ] ++ lib.optionals isPy27 [
42 futures
43 enum34
44 pathlib
45 ];
46
47 meta = with lib; {
48 description = "Read and write image data from and to TIFF files.";
49 homepage = "https://www.lfd.uci.edu/~gohlke/";
50 maintainers = [ maintainers.lebastr ];
51 license = licenses.bsd3;
52 };
53}