# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-aiosmtpd
pkgver=1.4.6
pkgrel=0
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=aiosmtpd
pkgdesc="asyncio based SMTP server"
url="https://github.com/aio-libs/aiosmtpd"
arch="noarch"
license="Apache-2.0"
depends="
	py3-attrs
	py3-atpublic
"
checkdepends="
	py3-pytest
	py3-pytest-asyncio
	py3-pytest-cov
	py3-pytest-mock
"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/aio-libs/aiosmtpd/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$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 "$builddir"/.dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

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

sha512sums="
ce920a3cf16920c4100f97db4630e738e9344e789042a8793d260d78f339e11917a42d9b438a43d2c73f259f0b83e47a98acc3d8ec8f34f0ff455b6a6a2cac09  py3-aiosmtpd-1.4.6.tar.gz
"
