# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-pontos
_pkgname=pontos
pkgver=25.1.0
pkgrel=0
pkgdesc="Common utilities and tools maintained by Greenbone Networks"
url="https://github.com/greenbone/pontos/"
arch="noarch"
license="Apache-2.0"
depends="
	py3-colorful
	py3-dateutil
	py3-h2
	py3-httpx
	py3-packaging
	py3-rich
	py3-semver
	py3-shtab
	py3-tomlkit
	python3
	"
makedepends="
	py3-gpep517
	py3-installer
	py3-poetry-core
	"
checkdepends="
	py3-pytest
	py3-pytest-httpx
	py3-lxml
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/greenbone/pontos/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$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

	# don't access gitconfigs
	touch "$srcdir"/x-git-config
	GIT_CONFIG_GLOBAL="$srcdir"/x-git-config \
		.testenv/bin/python3 -m pytest -k 'not test_git_error'
}

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

sha512sums="
6cbf3f5394f3b2b1f33db6788d78f22e2b52e56b626b479130e85a6ef36400fad7d70590bf1fb6d870d20ad3b952a23e5e6788bcc3524dc9adabb5ab951c0c9c  py3-pontos-25.1.0.tar.gz
"
