# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-websocket-client
pkgver=1.8.0
pkgrel=0
pkgdesc="WebSocket client library for Python"
url="https://github.com/websocket-client/websocket-client"
arch="noarch"
license="Apache-2.0"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-python-socks
	"
subpackages="$pkgname-pyc"
source="https://github.com/websocket-client/websocket-client/archive/v$pkgver/websocket-client-v$pkgver.tar.gz"
builddir="$srcdir/websocket-client-$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 unittest discover
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
	rm -r "$pkgdir"/usr/lib/python3*/site-packages/websocket/tests
}

sha512sums="
183102a78d625da32d384f37f1784e020d4856a66cb318aba9fd53be30200c6bbc13dc0d36d0b88bb13e5a56fa484ef58e70cb3744b9bf2daf4f7920518aaf8e  websocket-client-v1.8.0.tar.gz
"
