# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=py3-prawcore
pkgver=3.0.2
pkgrel=0
pkgdesc="Low-level communication layer for PRAW 4+"
url="https://github.com/praw-dev/prawcore"
arch="noarch"
license="BSD-2-Clause"
depends="
	py3-requests
	"
makedepends="py3-flit-core py3-gpep517 py3-wheel py3-installer"
checkdepends="
	py3-betamax
	py3-betamax_matchers
	py3-betamax_serializers
	py3-mock
	py3-pytest
	py3-testfixtures
	"
subpackages="$pkgname-pyc"
source="https://github.com/praw-dev/prawcore/archive/v$pkgver/prawcore-v$pkgver.tar.gz"
builddir="$srcdir/prawcore-$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 .dist/*.whl
	.testenv/bin/python3 -m pytest
}

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

sha512sums="
6f92e5c4f5ae3b45741ecb3692769b8f75a31f91657a42fa4c5a1a240f3317710be5925800a3f9cc533bcae4f8e817c160bece1bd686766e6776d9d024a0e60b  prawcore-v3.0.2.tar.gz
"
