# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Carl Smedstad <carsme@archlinux.org>

pkgname=python-aiosignal
pkgver=1.4.0
pkgrel=1
pkgdesc='List of registered asynchronous callbacks'
arch=('any')
url='https://github.com/aio-libs/aiosignal'
license=('Apache-2.0')
depends=(
  'python'
  'python-frozenlist'
)
makedepends=(
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
checkdepends=(
  'python-pytest'
  'python-pytest-asyncio'
)
source=("$url/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('dca12bf29b1e842fe7c8a01e302d82cbc33fd6df996ff5905d5edfed159d056e0002d13ff4e2823e03e9f262aaaaf01b0f984202cddeee2e00db522541e3f99e')
b2sums=('dbdeb0a5ab35da1d66e26635d53423dccba5992f808d0010c38ecc8107c488f7775cfe0fca046be7a0bfe6c340910813885dc16183dcec8ba13b339b1bc0e1fb')

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

check() {
  cd ${pkgname#python-}-$pkgver
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest -v --override-ini="addopts="
}

package() {
  cd ${pkgname#python-}-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 -t "$pkgdir/usr/share/doc/$pkgname" CHANGES.rst README.rst
}

# vim: ts=2 sw=2 et:
