# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-mopidy-spotify
pkgver=5.0.0_alpha3
pkgrel=0
pkgdesc="Mopidy extension for playing music from Spotify"
url="https://mopidy.com/ext/spotify/"
# blocked by gst-plugins-rs
arch="noarch !armhf !armv7 !ppc64le !riscv64 !s390x !x86"
license="Apache-2.0"
depends="
	gst-plugins-rs-spotify
	mopidy
	py3-responses
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/mopidy/mopidy-spotify/archive/refs/tags/v${pkgver//_alpha/a}.tar.gz"
builddir="$srcdir/mopidy-spotify-${pkgver//_alpha/a}"

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
	.testenv/bin/python3 -m pytest
}

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

sha512sums="
7294f9c2e9480ea28ba122393aaa32ab1478f63529211e72d908c1b8913f0304866335c981865f7a516175d16f446ae609a2d8e83ee8db5471f206b7a438ecba  py3-mopidy-spotify-5.0.0_alpha3.tar.gz
"
