# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-gvm
_pkgname=${pkgname/py3/python}
# follow the same version of gvm-tools
pkgver=24.8.0
pkgrel=0
pkgdesc="Greenbone Vulnerability Management Python Library "
url="https://github.com/greenbone/python-gvm"
arch="noarch"
license="GPL-3.0-or-later"
depends="python3 py3-paramiko py3-lxml py3-defusedxml py3-typing-extensions"
makedepends="py3-gpep517 py3-installer py3-poetry-core"
checkdepends="py3-defusedxml py3-pytest py3-lxml py3-paramiko py3-pontos"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/greenbone/$_pkgname/archive/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
	# hangs
	.testenv/bin/python3 -m pytest \
		--deselect=tests/connections/test_ssh_connection.py
}

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

sha512sums="
dbc3dee750299f6e39417a442551ffc82939073cf1c4fd46076dcf05f9c59c2568bf8fc075607b36950387e11b021eb75c542c022329ff8e7ac42293f8489db9  py3-gvm-24.8.0.tar.gz
"
