# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-uvloop
pkgver=0.19.0
pkgrel=1
pkgdesc="Ultra fast asyncio event loop"
url="https://github.com/MagicStack/uvloop"
license="MIT OR Apache-2.0"
arch="all"
makedepends="py3-setuptools python3-dev py3-wheel cython libuv-dev"
checkdepends="py3-pytest py3-aiohttp py3-openssl py3-psutil"
subpackages="$pkgname-pyc"
source="https://github.com/MagicStack/uvloop/archive/v$pkgver/py3-uvloop-$pkgver.tar.gz
	skip-broken-ppc64le-test.patch
	tcp-tests.patch
	cython3.patch
	"
builddir="$srcdir/uvloop-$pkgver"

build() {
	python3 setup.py build build_ext --inplace --cython-always --use-system-libuv
}

check() {
	PYTHONASYNCIODEBUG=1 PYTHONPATH="$(echo "$builddir"/build/lib.linux-*)" pytest -v \
		-k 'not test_remote_shutdown_receives_trailing_data and not test_getaddrinfo_8 and not test_getaddrinfo_9'
}

package() {
	python3 setup.py install --root="$pkgdir" --skip-build
}

sha512sums="
aa6b81ee81951504bd37ab73cf8ae908e121dba7a2f9fb06a7c3d9e6f7db87656162dfb4bef3157d9bd245485096a0c999b97e50658955abbc201dfaec8930f6  py3-uvloop-0.19.0.tar.gz
3dea46539b1d146b5ada29af675ee32b9c0ef4655c6ca45544ad41dfd66e192ae51b55e9b61b4bdc9e640407aca40927e73078ddeb9b2b39b2966d7f29b7f1c3  skip-broken-ppc64le-test.patch
6aaf9d78c28eb41df54b4720b9993b0b4e15a60a07663f7fa5aa18659f696e11e04c791e1c1712a1cac8b2fa47a363a92a070ec37ee100397f3ade55cabd1861  tcp-tests.patch
8a7424658bea5e6240dc452911e999eae66651669fc10f1155dcdb334de5d184e3a2fe4b566d34dedc142fab38271eeb608405573fa34644d3b5d81b56bd4087  cython3.patch
"
