# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Carl Smedstad <carsme@archlinux.org>
# Contributor: renek <aur@spaceshore.net>

pkgname=python-multidict
pkgver=6.7.1
pkgrel=1
pkgdesc='Asyncio-based multidict implementation for Python'
arch=('x86_64' 'aarch64')
url='https://github.com/aio-libs/multidict'
license=('Apache-2.0')
depends=(
  'glibc'
  'python'
)
makedepends=(
  'cython'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
checkdepends=(
  'python-objgraph'
  'python-perf'
  'python-psutil'
  'python-pytest'
  'python-pytest-codspeed'
)
source=("$url/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('4009a310dac4732c48cc9654fbd55468dda5a6d18a05ef013ff90b030d3124459620d6d6ae4f85e88ef6cefa0b9bccea1b745f3acbfa0b351eb2c92cc8812b89')
b2sums=('db03d9be850b3d2b042ecaa5484fd692fdb47a626862b57e2b218beeba90ae7b12a5e204bd3fdf20a4a125abf1dffb88c52cfc449c0daa31cfed585a74782a3f')

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
  cd tests
  ../test-env/bin/python -m pytest -v --override-ini="addopts="
}

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