# Contributor: Henrik Riomar <henrik.riomar@gmail.com>
# Maintainer: Henrik Riomar <henrik.riomar@gmail.com>
pkgname=gitlint
pkgver=0.19.1
pkgrel=2
pkgdesc="Linting for your git commit messages"
url="https://github.com/jorisroovers/gitlint"
arch="noarch"
license="MIT"
depends="
	py3-arrow
	py3-click
	"
makedepends="
	py3-gpep517
	py3-hatch-vcs
	py3-hatchling
	py3-installer
	py3-wheel
	"
checkdepends="
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="https://github.com/jorisroovers/gitlint/archive/v$pkgver/gitlint-$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver/gitlint-core"

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
}

sha512sums="
d7b1d99a7a578e5c50723af9a995f6a675d36b5c9175ac4f60b3e2fda05c708233beb35d07ae6fb6a1d492b21f0677013302daae3d3da350a0274935c8b922a0  gitlint-0.19.1.tar.gz
"
