# Contributor: fossdd <fossdd@pwned.life>
# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-pytest-codspeed
pkgver=3.2.0
pkgrel=1
pkgdesc="Pytest plugin to create CodSpeed benchmarks"
url="https://codspeed.io/"
arch="noarch"
license="MIT"
depends="
	py3-cffi
	py3-pytest
	py3-rich
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
subpackages="$pkgname-doc $pkgname-pyc"
source="py3-pytest-codspeed-$pkgver.tar.gz::https://github.com/CodSpeedHQ/pytest-codspeed/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/pytest-codspeed-$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

	install -Dm644 README.md -t "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}

sha512sums="
1740d543de11c82490891968070f209629c4927d4bec0994a08498794910bbbe63e60e3a1ea8899a0245ec39f9ecc117037232f3dafcf1781b28fca475f836a4  py3-pytest-codspeed-3.2.0.tar.gz
"
