# Contributor: psykose <alice@ayaya.dev>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-structlog
pkgver=24.4.0
pkgrel=0
pkgdesc="Simple, powerful, and fast logging for Python"
url="https://github.com/hynek/structlog"
arch="noarch"
license="Apache-2.0 OR MIT"
makedepends="
	py3-gpep517
	py3-hatch-fancy-pypi-readme
	py3-hatch-vcs
	py3-hatchling
	py3-wheel
	"
checkdepends="
	py3-coverage
	py3-freezegun
	py3-pretend
	py3-pytest
	py3-pytest-asyncio
	py3-pytest-xdist
	py3-rich
	py3-simplejson
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/hynek/structlog/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/structlog-$pkgver"

build() {
	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 -n4
}

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

sha512sums="
b1a3614659f75ce3312dcb18f4ec77421383f0d90a18517ec32e1d9ea91e2604839ccafdfbfe343a3fae90c0e407cf6fb8aa7cd7d4d928eaf78ced8a1bd366d5  py3-structlog-24.4.0.tar.gz
"
