python3Packages.tifffile: refactor

This commit is contained in:
Fabian Affolter 2022-01-14 17:00:05 +01:00
parent 36797a3c65
commit e956c76632

View File

@ -1,53 +1,55 @@
{ lib { lib
, fetchPypi
, buildPythonPackage , buildPythonPackage
, isPy27 , dask
, isPy3k , fetchPypi
, fsspec
, lxml
, numpy , numpy
, imagecodecs-lite , pytestCheckHook
, enum34 ? null , pythonOlder
, futures ? null , zarr
, pathlib ? null
, pytest
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "tifffile"; pname = "tifffile";
version = "2021.11.2"; version = "2021.11.2";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
sha256 = "153e31fa1d892f482fabb2ae9f2561fa429ee42d01a6f67e58cee13637d9285b"; hash = "sha256-FT4x+h2JL0gvq7KunyVh+kKe5C0BpvZ+WM7hNjfZKFs=";
}; };
patches = lib.optional isPy27 ./python2-regex-compat.patch;
# Missing dependencies: imagecodecs, czifile, cmapfile, oiffile, lfdfiles
# and test data missing from PyPI tarball
doCheck = false;
checkInputs = [
pytest
];
checkPhase = ''
pytest
'';
propagatedBuildInputs = [ propagatedBuildInputs = [
numpy numpy
] ++ lib.optionals isPy3k [ ];
imagecodecs-lite
] ++ lib.optionals isPy27 [ checkInputs = [
futures dask
enum34 fsspec
pathlib lxml
pytestCheckHook
zarr
];
disabledTests = [
# Test require network access
"test_class_omexml"
"test_write_ome"
# Test file is missing
"test_write_predictor"
];
pythonImportsCheck = [
"tifffile"
]; ];
meta = with lib; { meta = with lib; {
description = "Read and write image data from and to TIFF files."; description = "Read and write image data from and to TIFF files";
homepage = "https://www.lfd.uci.edu/~gohlke/"; homepage = "https://github.com/cgohlke/tifffile/";
maintainers = [ maintainers.lebastr ];
license = licenses.bsd3; license = licenses.bsd3;
maintainers = with maintainers; [ lebastr ];
}; };
} }