# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Chih-Hsuan Yen <yan12125@archlinux.org>

pkgname=httpbin
pkgver=0.10.2
pkgrel=1
pkgdesc="HTTP Request and Response Service"
arch=('any')
url="https://github.com/psf/httpbin"
license=('MIT' 'custom:ISC')
depends=('python' 'python-flask' 'python-decorator' 'python-six'
         'python-brotlicffi' 'python-werkzeug' 'python-flasgger'
         # Not directly used. TODO: ask upstream if it's really needed
         'python-greenlet')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-pytest')
source=("$pkgname-$pkgver.tar.gz::https://github.com/psf/httpbin/archive/release-v$pkgver.tar.gz")
sha512sums=('f271d4d93c7d19392955233a48b7e31f17b76d3364e88cccc081abd2da3763b7b8997778f24e4b756a8219e653809f34b77431723d403348a781f98197376277')

build() {
  cd httpbin-release-v$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd httpbin-release-v$pkgver
  pytest tests
}

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

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

# vim:set ts=2 sw=2 et:
