# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-pontos
_pkgname=pontos
pkgver=24.9.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="
1b78ead31551d9a5ce343bd482853086c3e81425a03ac429352851ef91703462723d3d258c27cb003b93c61ab8258f98f2abade40e0d9c3ce973f224821fcff0  py3-pontos-24.9.0.tar.gz
"
