# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-remoto
_pkgname=remoto
pkgver=1.2.1
pkgrel=6
pkgdesc="Execute remote commands or processes"
url="https://github.com/alfredodeza/remoto"
arch="noarch"
license="MIT"
depends="py3-execnet"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-mock py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/r/remoto/remoto-$pkgver.tar.gz
	pytest8.patch
	"
builddir="$srcdir/$_pkgname-$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
}

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

	# Remove installed-tests
	rm -rf "$pkgdir"/usr/lib/python3*/site-packages/remoto/tests
}

sha512sums="
c2593d93bd53f5aada39318f575dc27ddbbd1cb86dae75db6111b49eff0708d7f242072ee173c57aad466a4e5dc2c4f6d173cbc85c3764c7060205afc4583e53  py3-remoto-1.2.1.tar.gz
103693c035a1ad0f0e0fc103e82e3c83c5a6b64ad52f186b05d18a1cd7f23102b1d1f3080e4db2cf23b12442f493227651e0110b45af9a39cb1a24983f1482e0  pytest8.patch
"
