# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-pytest-celery
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=pytest-celery
pkgver=1.2.0
pkgrel=0
pkgdesc="Official pytest plugin for Celery."
url="https://github.com/celery/pytest-celery"
arch="noarch"
license="BSD-3-Clause"
depends="
	py3-redis
	py3-python-memcached
	py3-pytest-docker-tools
	py3-tenacity
	py3-psutil
"
checkdepends="
	py3-celery
	py3-pytest
	py3-coverage
	py3-pytest-sugar
	py3-pytest-cov
	py3-pytest-xdist
	py3-pytest-subtests
	py3-pytest-rerunfailures
"
makedepends="
	poetry
	py3-setuptools
	py3-gpep517
	py3-wheel
"
options="!check" # requires docker and has circular dependency with py3-celery
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/celery/pytest-celery/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"

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 "$builddir"/.dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

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

sha512sums="
30d2114ca461a3824eeec2f082db8ccbc6370744a95f9702dc42016ae0b98ba81f6f9e529df9742fe88b365ae88b19b8a830164f23987b3f9f5034bfaa2e06a0  py3-pytest-celery-1.2.0.tar.gz
"
