# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-trustme
pkgver=1.2.1
pkgrel=0
pkgdesc="#1 quality TLS certs while you wait, for the discerning tester"
url="https://github.com/python-trio/trustme"
arch="noarch"
license="Apache-2.0 OR MIT"
depends="
	py3-cryptography
	py3-idna
	py3-openssl
	py3-service_identity
	python3
	"
makedepends="py3-setuptools py3-wheel py3-gpep517 py3-hatchling"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/t/trustme/trustme-$pkgver.tar.gz"
builddir="$srcdir/trustme-$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
	PYTHONPATH="$PWD/build/lib" \
	testenv/bin/python3 -m pytest
}

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

sha512sums="
3dc5158294d79603378a281e706ea6b376833a40621c211f12c383bc1ef0720b2b6c1441eadab43292cbeee34aaa4618ed8ce4b8dedc4ca6f1faa14e4cb485bc  trustme-1.2.1.tar.gz
"
