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

pkgname=python-apispec
pkgver=6.0.2
pkgrel=4
pkgdesc="A pluggable API specification generator. Currently supports the OpenAPI Specification."
url="https://github.com/marshmallow-code/apispec"
license=('MIT')
arch=('any')
depends=('python-packaging')
optdepends=('python-yaml: for yaml support'
            'python-prance: for validation'
            'python-openapi-spec-validator: for validation')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-tornado' 'python-bottle' 'python-marshmallow'
              'python-flask' 'python-prance' 'python-yaml'
              'python-openapi-spec-validator' 'python-pytest')
source=("$pkgname-$pkgver.tar.gz::https://github.com/marshmallow-code/apispec/archive/$pkgver.tar.gz")
sha512sums=('aa5e2cc41d5b3c4555da929819135df30192e6f6ff08518d62674495f0d28c14e51a0aa111b289e5f9d7205f821c1fd4e28b914899ea3e15b3e20f6052258117')

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

check() {
  cd apispec-$pkgver
  PYTHONPATH=src pytest -k 'not test_schema_instance_with_different_modifers_custom_resolver' .
}

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