# Maintainer: Astro Benzene # Contributor: Francois Boulogne pkgname=python-tifffile pkgver=2022.2.2 _pyname=${pkgname#python-} pkgrel=1 pkgdesc="Read and write image data from and to TIFF files" arch=('any') url="https://github.com/cgohlke/tifffile" license=('BSD') makedepends=('python-setuptools') depends=('python-numpy>=1.21.5') optdepends=('python-matplotlib>=3.4.3: required only for plotting' 'python-imagecodecs>=2021.11.20: required only for encoding or decoding LZW, JPEG, etc' 'python-lxml>=4.7.1: required only for validating and printing XML' 'python-zarr>=2.10.3: required only for opening zarr storage') checkdepends=('python-pytest' 'python-fsspec') source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz") sha256sums=('c4ff0ed150803c1dc2ab4b762049c43ea649202b33194309499e1edfee9523b9') build() { cd ${srcdir}/${_pyname}-${pkgver} python setup.py build } check() { cd ${srcdir}/${_pyname}-${pkgver} # From Gentoo's ebuild PYTHONPATH="build/lib" pytest \ --deselect=tests/test_tifffile.py::test_class_omexml \ --deselect=tests/test_tifffile.py::test_class_omexml_fail \ --deselect=tests/test_tifffile.py::test_class_omexml_modulo \ --deselect=tests/test_tifffile.py::test_class_omexml_attributes \ --deselect=tests/test_tifffile.py::test_class_omexml_multiimage \ --deselect=tests/test_tifffile.py::test_write_ome \ --deselect=tests/test_tifffile.py::test_write_ome_manual \ --deselect=tests/test_tifffile.py::test_write_3gb \ --deselect=tests/test_tifffile.py::test_write_bigtiff \ --deselect=tests/test_tifffile.py::test_write_imagej_raw \ --deselect=tests/test_tifffile.py::test_write_predictor || warning "Tests failed" } package() { cd ${srcdir}/${_pyname}-${pkgver} install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}" install -Dm644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}" python setup.py install --root="${pkgdir}" --optimize=1 } # vim:ts=2:sw=2:et: