# 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.1.3
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="
4ea7f972eb52dbd679ec9e90364e4e7daf7f027499ec049f0a1e37a1d80b38df24704b8d1852f3c4de685dbd00dff7b2bdb65fd12053fa76dc60ace81b66b6f2  py3-pytest-celery-1.1.3.tar.gz
"
