# Maintainer: Luca Weiss <luca@lucaweiss.eu>
pkgname=py3-dbusmock
pkgver=0.35.0
pkgrel=0
pkgdesc="Mock D-Bus objects for tests"
url="https://github.com/martinpitt/python-dbusmock"
arch="noarch"
license="LGPL-3.0-or-later"
depends="dbus py3-dbus py3-gobject3"
makedepends="py3-gpep517 py3-setuptools py3-wheel python3-dev"
checkdepends="bash py3-nose py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/python-dbusmock/python_dbusmock-$pkgver.tar.gz"
builddir="$srcdir/python_dbusmock-$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
	# Skip test requiring upower which would create a circular dependency
	.testenv/bin/python3 -m pytest -k 'not test_dbusmock_test_template'
}

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

sha512sums="
ac1a55355127ce68f4c849ef410ed4bbfd7ade49c4f0452e284c1eedc08e5eeb3042e37ac8bd6703bde9740accd03b5817094bc9bcaf4f3f3724fc149958de63  python_dbusmock-0.35.0.tar.gz
"
