# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-service_identity
_pkgname=service-identity
pkgver=24.2.0
pkgrel=0
pkgdesc="Service identity verification for pyOpenSSL & cryptography."
url="https://pypi.org/project/service-identity/"
arch="noarch"
license="MIT"
depends="py3-asn1 py3-asn1-modules py3-attrs py3-cryptography"
makedepends="py3-gpep517 py3-hatchling py3-hatch-vcs"
checkdepends="py3-idna py3-openssl py3-pytest-runner"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/pyca/service-identity/archive/$pkgver.tar.gz
	remove-fancy-pypi-readme.patch
	"
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
	.testenv/bin/python3 -m pytest
}

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

sha512sums="
a2630402a87c8e1de67d2b936eecd686cdae94fb87fb232cae1bfb17496e1512f942c681f488f56bb599f9bd0448b7c60f782c395232ec6e42d3116d044fbd4c  py3-service_identity-24.2.0.tar.gz
16df986e2f1da7d19788f9a2d0ef9d2b8a30c7c083aac63f0b12ab4a28b9036cc000946a434d73de41de4678e95ad434cff384bfae5e9ae952b7aeaa4128f88e  remove-fancy-pypi-readme.patch
"
