# Contributor: Síle Ekaterin Liszka <sheila@vulpine.house>
# Maintainer: Síle Ekaterin Liszka <sheila@vulpine.house>
pkgname=git-archive-all
pkgver=1.23.1
pkgrel=4
pkgdesc="Wrapper for git-archive that archives a git superproject and its submodules"
url="https://github.com/Kentzo/git-archive-all"
arch="noarch"
options="!check" # broken testsuite
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pycodestyle py3-pytest py3-pytest-cov py3-pytest-mock"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Kentzo/git-archive-all/archive/refs/tags/$pkgver.tar.gz"

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
}

sha512sums="
2d72551ae8dd41b40984ff5a5efebece7989e212345193f624979772755af570ba4e6147d73ee542f19fc38b90cabd617ec41f20ba4a0128c4fb01000c48ccef  git-archive-all-1.23.1.tar.gz
"
