# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=py3-zstd
pkgver=1.5.5.1
pkgrel=1
pkgdesc="Simple Python bindings to Yann Collet ZSTD compression library"
url="https://pypi.org/project/zstd/"
arch="all"
license="BSD-2-Clause"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	zstd-dev
	"
checkdepends="py3-pytest-forked"
source="https://github.com/sergey-dryabzhinsky/python-zstd/archive/v$pkgver/py3-zstd-$pkgver.tar.gz"
builddir="$srcdir/python-zstd-$pkgver"

build() {
	export ZSTD_EXTERNAL="true"
	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 --forked
}

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

sha512sums="
4e5917aaaedae70e45d98cd954b234e12932e87f05adb53f26e64fec0279bef1cdbcc7dd9292db3d934eda74d865acfd5ad0ca2be469080c28891d5b3fbd13de  py3-zstd-1.5.5.1.tar.gz
"
