# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-hishel
pkgver=0.0.33
pkgrel=0
pkgdesc="Elegant HTTP Cache implementation for HTTPX and HTTP Core"
url="https://github.com/karpetrosyan/hishel"
arch="noarch"
license="BSD-3-Clause"
depends="py3-httpx py3-typing-extensions"
makedepends="py3-gpep517 py3-hatchling"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/karpetrosyan/hishel/archive/$pkgver/py3-hishel-$pkgver.tar.gz
	no-fancy-readme.patch
	"
builddir="$srcdir/hishel-$pkgver"
options="!check" # tests require redis and unpackaged modules

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

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

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

sha512sums="
c69261b0f3af45c57f9d95114bfe03c64c7f6490429f9c00dbad41935da16a3125c08d4aaf613686a29c54b5a13b1884dd0c298b718158b25ee28422f3c236be  py3-hishel-0.0.33.tar.gz
d8f9eff131512632b17739ea74ca2dc776ac072eb1eff537ec40daa9e99a720ebf5ba61a0aefdfd405fa39d8454d12c024652eb958b3518271a295e4fa395c8e  no-fancy-readme.patch
"
