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

pkgname=python-yarl
pkgver=1.23.0
pkgrel=1
pkgdesc='Yet another URL library'
arch=('x86_64' 'aarch64')
url='https://github.com/aio-libs/yarl/'
license=('Apache-2.0')
depends=(
  'glibc'
  'python'
  'python-idna'
  'python-multidict'
  'python-propcache'
)
makedepends=(
  'cython'
  'python-setuptools'
  'python-build'
  'python-installer'
  'python-wheel'
  'python-expandvars'
)
checkdepends=(
  'python-hypothesis'
  'python-pytest'
)
source=("$url/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('65c381440e19a46caca0256cda022ce519efd9351e1a8b42395e1e21b0cb8924ee0fc29a354636147ca4b4e899657d5d5f4963218e592805ba6134c9a851e310')
b2sums=('e53266617915ad595b08eaa4802b7fa4a0dd47819118a0f31461d3db20d9b6ea0f71e9b3661148806a501583a7d55002e7910ef6b2ea3eef7263dae9f86e5f82')

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 -Pm pytest -v --override-ini="addopts="
}

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