# Contributor: Justin Berthault <justin.berthault@zaclys.net>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=py3-daiquiri
pkgver=3.3.0
pkgrel=0
pkgdesc="Library to configure Python logging easily"
url="https://github.com/Mergifyio/daiquiri"
arch="noarch"
license="Apache-2.0"
depends="py3-json-logger"
makedepends="
	py3-gpep517
	py3-installer
	py3-setuptools
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="py3-mock py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Mergifyio/daiquiri/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/daiquiri-$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/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
	rm -rf "$pkgdir"/usr/lib/python3*/site-packages/daiquiri/tests
}

sha512sums="
20c5952bbf0bdbaf2f761c531e7a667de8c26d3e930e2d8abf600ecea735c0330109455aa1b1067320a7f1dde7c462e23626565958dd1db50073e977bfde5703  py3-daiquiri-3.3.0.tar.gz
"
