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

pkgname=python-apispec-webframeworks
pkgver=1.2.0
pkgrel=1
pkgdesc="Web framework plugins for apispec"
url="https://github.com/marshmallow-code/apispec-webframeworks"
license=('MIT')
arch=('any')
depends=('python-apispec' 'python-yaml')
makedepends=('python-flit-core' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-pytest' 'python-bottle' 'python-flask' 'python-tornado' 'python-aiohttp')
source=("$pkgname-$pkgver.tar.gz::https://github.com/marshmallow-code/apispec-webframeworks/archive/$pkgver.tar.gz")
sha512sums=('82a43a8c3a888f1d8745751bde6dfe3a59e3b4418a3019962d86a1922cb7e7be8746d9faebc70f010bfdd90b13cdf123feef2f4f6877d205258788620e6707a8')

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

check() {
  cd apispec-webframeworks-$pkgver
  PYTHONPATH=src pytest .
}

package() {
  cd apispec-webframeworks-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
