# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-pykka
pkgver=4.2.0
pkgrel=0
pkgdesc="Concurrency abstractions for Python3 using the actor model"
url="https://pykka.readthedocs.org/"
arch="noarch"
license="Apache-2.0"
makedepends="
	py3-gpep517
	py3-hatchling
	py3-installer
	"
checkdepends="
	py3-mock
	py3-pytest
	py3-pytest-mock
	"
subpackages="$pkgname-pyc"
source="https://github.com/jodal/pykka/archive/v$pkgver/pykka-$pkgver.tar.gz"
builddir="$srcdir/pykka-$pkgver"

replaces="py-pykka" # Backwards compatibility
provides="py-pykka=$pkgver-r$pkgrel" # Backwards compatibility

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="
55de2fb603e642ffa91887d0fc69b3785bfae7de71911b45b336285f487c38feb07bd8033188b3ddaef884d5b0c0b789809be8ad8c0cfa9ac84c95485870178d  pykka-4.2.0.tar.gz
"
