# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-wand
pkgver=0.7.0
pkgrel=1
pkgdesc="Ctypes-based simple MagickWand API binding for Python"
url="https://github.com/emcconville/wand"
license=('MIT')
arch=('any')
depends=('imagemagick' 'libxml2' 'python')
makedepends=('git' 'python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-pytest' 'python-pytest-forked' 'python-pytest-xdist'
              'python-psutil' 'ghostscript' 'librsvg')
source=("git+https://github.com/emcconville/wand.git#tag=$pkgver")
sha512sums=('9205af21a72e02166c98a28223be1afec27da6c92eb59f0cefd1c71f9cebd6c303005220da1ed7924627f9a9eaff2efc4edf970d40d557d06737e652b58ae807')

build() {
  cd wand
  PYTHONPATH="$PWD" python -m build --wheel --no-isolation
}

check() {
  cd wand
  pytest --deselect tests/image_methods_test.py::test_forward_fourier_transform \
         --deselect tests/image_methods_test.py::test_inverse_fourier_transform
}

package() {
  cd wand
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
