# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-circuitbreaker
pkgver=2.0.0
pkgrel=1
pkgdesc="Python Circuit Breaker pattern implementation"
url="https://github.com/fabfuel/circuitbreaker"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-mock py3-pytest-tornasync"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/c/circuitbreaker/circuitbreaker-$pkgver.tar.gz"
builddir="$srcdir/circuitbreaker-$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 -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
f719182c36bf72813a3cf497c2eba01d3dba549bcec11bd2e95bd4b9007536c7f7cf2329051dee2a4139d22f13fe7f13132d975b92d6de1b86be044ef6f45258  circuitbreaker-2.0.0.tar.gz
"
