# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=py3-pynvim
_pyname=pynvim
pkgver=0.5.0
pkgrel=1
pkgdesc="python client and plugin host for Nvim"
url="https://github.com/neovim/pynvim"
arch="noarch"
license="Apache-2.0"
depends="neovim py3-msgpack py3-greenlet"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-runner"
subpackages="$pkgname-pyc"
source="$_pyname-$pkgver.tar.gz::https://github.com/neovim/$_pyname/archive/$pkgver.tar.gz
	fix-tests.patch
	"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --system-site-packages testenv
	testenv/bin/python3 -m installer dist/*.whl
	testenv/bin/python3 -m pytest
}

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

sha512sums="
91ffe3f42cc23ba372223b8c9f6930b0cff9d30b6764052a77a5c34e39a3312a1834b9a753152e96d04d5b4b61ce647bd7470095fac3122ae6b1346dcdf07f2f  pynvim-0.5.0.tar.gz
9af5f7d4f1ea1cdb4e81e4af78ceb5050a08a3184dd70aedfd4e6ddee6677650d8d4d502db6c98a50e9470da31f38f8b0c86edc2269e298692869ce3f8780442  fix-tests.patch
"
