# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=py3-pem
pkgver=23.1.0
pkgrel=1
pkgdesc="Easy PEM file parsing"
url="https://pem.readthedocs.io/en/stable/"
arch="noarch"
license="MIT"
depends="python3 py3-twisted"
makedepends="
	py3-gpep517
	py3-hatch-fancy-pypi-readme
	py3-hatch-vcs
	py3-hatchling
	py3-installer
	py3-wheel
	"
checkdepends="py3-pytest py3-certifi py3-openssl py3-pretend"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/hynek/pem/archive/$pkgver.tar.gz"
builddir="$srcdir/pem-$pkgver"

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	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="
e29218c7b3c16bd21a22fe4026edbea34b4de2dbdb96f249f4e173794dada20b890b21a5e9bdb121b4aa362be83d09d0ea85ae1512fed6838fe4a80d4a9ccde8  py3-pem-23.1.0.tar.gz
"
