# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Carl Smedstad <carsme@archlinux.org>

pkgname=python-pyasynchat
_pkgname=${pkgname#python-}
pkgver=1.0.4
pkgrel=4
pkgdesc="Make asynchat available for Python 3.12 onwards"
arch=(any)
url="https://github.com/simonrob/pyasynchat"
license=(PSF-2.0)
depends=(
  python
  python-pyasyncore
)
makedepends=(
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(python-tests)
provides=(python-asynchat)
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver/$pkgver.tar.gz")
sha256sums=('2f7085cb9f4f7aaa0aef675c799fcd2f3032d6aec9c9845330972105cf22dd23')

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

check() {
  cd "$_pkgname-$pkgver"
  python -m unittest discover -v
}

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