# Contributor: Bart Ribbers <bribbers@disroot.org>
# Contributor: fossdd <fossdd@pwned.life>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=py3-mautrix
pkgver=0.20.6
pkgrel=0
pkgdesc="Python 3 asyncio Matrix framework"
url="https://github.com/mautrix/python"
arch="noarch"
license="MPL-2.0"
depends="
	py3-aiohttp
	py3-aiosqlite
	py3-asyncpg
	py3-attrs
	py3-commonmark
	py3-lxml
	py3-olm
	py3-pycryptodome
	py3-ruamel.yaml
	py3-sqlalchemy
	py3-unpaddedbase64
	python3
	"
makedepends="
	py3-gpep517
	py3-installer
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-pytest
	py3-pytest-asyncio
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/mautrix/python/archive/v$pkgver/mautrix-python-v$pkgver.tar.gz"
builddir="$srcdir/python-$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 -v
}

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

sha512sums="
0fb345369184e70ba2656906ae4257237d2b5fdfb52064f0ff6baf696247100816249b457f7471f5ae14acfd4be737dc2f20067ccb5cfed16bfd2d07fc29c689  py3-mautrix-0.20.6.tar.gz
"
