# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-pytest-asyncio
pkgver=0.25.0
pkgrel=0
pkgdesc="Pytest support for asyncio"
url="https://github.com/pytest-dev/pytest-asyncio"
arch="noarch"
license="Apache-2.0"
depends="py3-pytest"
makedepends="py3-setuptools py3-setuptools_scm py3-gpep517 py3-installer py3-wheel"
checkdepends="py3-async_generator py3-coverage py3-hypothesis py3-flaky py3-pytest-trio"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/pytest-dev/pytest-asyncio/archive/v$pkgver.tar.gz"
builddir="$srcdir/pytest-asyncio-$pkgver"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	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/pytest_asyncio-*.whl
	.testenv/bin/python3 -m pytest
}

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

sha512sums="
5b30f74860273c92ecb3deab2ba1b725468273d10d5eda525639ef644c2af158d98b65026297efdc00d5efe4a13331d612eff65d886de1fd88df3d9f639a5007  py3-pytest-asyncio-0.25.0.tar.gz
"
