# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=py3-terminado
pkgver=0.18.1
pkgrel=0
pkgdesc="Tornado websocket backend for xterm.js"
url="https://github.com/jupyter/terminado"
arch="noarch"
license="BSD-2-Clause"
depends="py3-ptyprocess py3-tornado"
makedepends="py3-gpep517 py3-hatchling"
checkdepends="py3-pytest py3-pytest-timeout"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/jupyter/terminado/archive/refs/tags/v$pkgver.tar.gz
	bash.patch
	ResourceWarning.patch
	"
builddir="$srcdir/terminado-$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 \
		--deselect tests/basic_test.py::UniqueTermTests::test_large_io_doesnt_hang
}

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

sha512sums="
0c0c6b014eb72aca5799803e8d6c835d69265419bd8b23a1ad34c07b2c4c752207d263facfa9a277a806004886682434cf3176a24b87bd6c67b208283aa17d0b  py3-terminado-0.18.1.tar.gz
3e731470ad7d1a5f833e94f0912e2e1941d5337ff52016f94b5a918c78e8b0408aa01b2cba4d6ace64c3f64bc89a7e0e4f8319925afe8e4df00ed480a43fe29b  bash.patch
10528d797a0c06ccf8eddae7aa5d8e76f999f5b3d96f498298656b214696b943fd269cce7ff6cbe24ad8335aed02ec16af11e8408e275a2841f2c2fb32a76710  ResourceWarning.patch
"
