# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Kyle Keen <keenerd@gmail.com>
# Contributor: Lex Black <autumn-wind at web dot de>
# Contributor: PiC0 <guill.p.linux@gmail.com>

pkgname=python-xmltodict
pkgver=1.0.2
pkgrel=1
pkgdesc='Python module that makes working with XML feel like you are working with JSON'
arch=(any)
url='https://github.com/martinblech/xmltodict'
license=(MIT)
depends=(python)
makedepends=(
  git
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(python-pytest)
source=("$pkgname::git+$url#tag=v$pkgver")
sha512sums=('107942e55a57f60913b62f918b4e11b9afb14a7a7a38f0b8ebacf2bf8fae4d8621b8f7a4a99073f6e9b627d0db8b1532fdd52f1dede15a49629e01cb75214e6b')
b2sums=('254ebb2ccd13c85bcc9a4d6b75f7662d6356155e33fc137c46c9bf95a67afee8a43aa9c7a3a416a1ce3b0a940998e23d424cebfdd4da98daf20cfba51e6c72de')

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

check() {
  cd "$pkgname"

  pytest -v
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
