# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-marshmallow
pkgver=3.20.2
pkgrel=4
pkgdesc="A lightweight library for converting complex datatypes to and from native Python datatypes."
url="https://github.com/marshmallow-code/marshmallow"
license=('MIT')
arch=(any)
depends=('python-packaging')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-pytest' 'python-simplejson' 'python-pytz' 'python-dateutil')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha512sums=('8305693405a976c53333b0c6ef074a12af4736f9620ca37c7c2ec6318fac2b19086426344ce8c2f515e95becdba8b2bb1c20aca5a9dffb4145cb27fee00dc080')

build() {
  cd marshmallow-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd marshmallow-$pkgver
  PYTHONPATH=src pytest
}

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