# Contributor: Justin Berthault <justin.berthault@zaclys.net>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=py3-daiquiri
pkgver=3.2.5.1
pkgrel=1
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="
7cb085ed5a27a8e13878413a2ec99e93a5cb984be2e702cf1516276f6418c15c62868ddf1bd8c1e634836f6377abc5ad9f775e268b72e0309f5ed52ad0001f56  py3-daiquiri-3.2.5.1.tar.gz
"
