# 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.4
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=('398c2eb71c44612fc34b001445f2771257af86389127070db0016e2b56378ee66aefb239518fc4e5c11bb1b2590b0155ec412290dc540670015d2be46d6875e9')
b2sums=('4bdb607ea34785a6237cca5e53addd799be8df6ca29e2c9b05eaf4bb5555dd7558d19b3e321b76a2f04d97b5865cbdd27133d717f025a99fbd7c47513f8bfce7')

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
}
