# Maintainer: Eivind Uggedal <eu@eju.no>
pkgname=py3-hiredis
pkgver=3.2.1
pkgrel=0
pkgdesc="Python extension that wraps hiredis"
url="https://github.com/redis/hiredis-py"
arch="all"
license="BSD-3-Clause"
makedepends="hiredis-dev python3-dev py3-gpep517 py3-wheel py3-setuptools"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/redis/hiredis-py/archive/v$pkgver.tar.gz
	fix-setup.patch
	"
builddir="$srcdir"/hiredis-py-$pkgver

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	PYTHONPATH="$(echo "$builddir"/build/lib.linux-*)" pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
eac9299f3de448628111fa25d6dde5faaec95f3f80120ebc9b659e1b4336c84e10c04084dd8d14eda279589ffcf6b18064b37fa8f5fd358d63e8fd1a02309b9f  py3-hiredis-3.2.1.tar.gz
87b01c3fa06e364b5a7943eecba712e952690b560a111025e1fb1b49b257ab0c7282e90ca3af294cc2ca992b994650f574e27ed03588f25ced2f286a41c9f92b  fix-setup.patch
"
