# Contributor: Ivan Tham <pickfire@riseup.net>
# Maintainer:
pkgname=py3-pyautogui
_pkgname=PyAutoGUI
# upstream does not tag releases https://github.com/asweigart/pyautogui/issues/270
_commit=9de7b3ebf8817a846b03caec0775ecbf4596452b
pkgver=0.9.53
pkgrel=5
pkgdesc="A cross-platform Python module for GUI automation for human beings"
url="https://pyautogui.readthedocs.io/"
arch="noarch"
license="BSD-3-Clause"
depends="
	py3-pillow
	py3-pymsgbox
	py3-pyscreeze
	py3-pytweening
	py3-xlib
	python3
	"
makedepends="py3-setuptools py3-gpep517"
checkdepends="xvfb-run"
subpackages="$pkgname-pyc"
source="$_pkgname-$_commit.tar.gz::https://github.com/asweigart/pyautogui/archive/$_commit.tar.gz"
builddir="$srcdir/pyautogui-$_commit"
options="!check" # hang forever

replaces="py-pyautogui" # Backwards compatibility
provides="py-pyautogui=$pkgver-r$pkgrel" # Backwards compatibility

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

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	xvfb-run -a .testenv/bin/python3 tests/test_pyautogui.py
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
afa4d3fde6a79d6946c520c536d64d5f76ae7982eb7a5ed4dd0c86bececc232a0e08e25705dc8cd184876ae24b8630fb0721042ee9653533798617344b0bf945  PyAutoGUI-9de7b3ebf8817a846b03caec0775ecbf4596452b.tar.gz
"
