# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-service_identity
_pkgname=service-identity
pkgver=24.1.0
pkgrel=1
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="
e027536ccc85b5823dcbdc1f402ba151b02bd4576e4a2897cd33929724772968602da763fd9ee173be0f61e0d0fc71d16f3286c0d88a1285a2c5c51f586d4b75  py3-service_identity-24.1.0.tar.gz
16df986e2f1da7d19788f9a2d0ef9d2b8a30c7c083aac63f0b12ab4a28b9036cc000946a434d73de41de4678e95ad434cff384bfae5e9ae952b7aeaa4128f88e  remove-fancy-pypi-readme.patch
"
