# Contributor: omni <omni+alpine@hack.org>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=py3-managesieve
_pkgname=managesieve
pkgver=0.8
pkgrel=0
pkgdesc="ManageSieve client library, including user application sieveshell"
url="https://managesieve.readthedocs.io/"
arch="noarch"
license="PSF-2.0 AND GPL-3.0-or-later"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-runner"
subpackages="$pkgname-pyc"
source="https://gitlab.com/htgoebel/managesieve/-/archive/v$pkgver/managesieve-v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-v$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
	.testenv/bin/python3 -m pytest
}

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

sha512sums="
f890698b8f47fb39a358b71d3dab508df688614d7938c94bc40f6343a662ed077e48ec957a6cb8c977ba3460819cf83ef065d2dcf1dac5ccc75853ebbc457b44  managesieve-v0.8.tar.gz
"
