# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-asn1
pkgver=0.6.1
pkgrel=0
pkgdesc="Python3 ASN1 library"
url="https://github.com/pyasn1/pyasn1"
arch="noarch"
license="BSD-2-Clause"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/pyasn1/pyasn1-$pkgver.tar.gz"
builddir="$srcdir/pyasn1-$pkgver"

replaces="py-asn1" # Backwards compatibility
provides="py-asn1=$pkgver-r$pkgrel" # Backwards compatibility

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="
a85036aeafc899b72a0dbd6adfe43d6b4d6ac8e79e2c8a043534ff9298c3a1942aeac42241fcc8a57bf89a9be845fecb01d3814bf812260ec7f370fa2f56e774  pyasn1-0.6.1.tar.gz
"
