# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-qtpy
_pkgorig=qtpy
pkgver=2.4.2
pkgrel=0
pkgdesc="QtPy: Abstraction layer for PyQt5/PySide2/PyQt6/PySide6"
url="https://github.com/spyder-ide/qtpy"
arch="noarch"
license="MIT"
depends="python3 py3-packaging"
checkdepends="py3-pytest py3-pytest-cov py3-pytest-qt py3-qt5 xvfb-run"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="https://github.com/spyder-ide/qtpy/archive/v$pkgver/$_pkgorig-$pkgver.tar.gz"
builddir="$srcdir/qtpy-$pkgver"

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

check() {
	xvfb-run -a python3 -m pytest -k 'not test_qtlocation and not test_qtpositioning and not test_qtsql and not test_qttexttospeech and not test_qtxmlpatterns and not test_qfontmetrics_width'
}

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

	rm -r "$pkgdir"/usr/lib/python3.*/site-packages/qtpy/tests
}

sha512sums="
4c1267267205984a57c80ceb9991779f9d10f6a4b1528b6ccd4132d0b59d4ad104c7791799f23837f8e7598721905c35f7a60b3c50f2e56948e9f880a0b02e14  qtpy-2.4.2.tar.gz
"
