# 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.3
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="
6ab2bb19485505ed593e90eb542ddb36bdd6d9c1f97ea017d0418ed362cd0b0f752e5c3bdbc1da703253bf8c4fd82d9893927706e389134af729f6e0bc982d4a  qtpy-2.4.3.tar.gz
"
