# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-mopidy-youtube
pkgver=3.7
pkgrel=2
pkgdesc="Mopidy extension for playing music from YouTube"
url="https://github.com/natumbri/mopidy-youtube"
arch="noarch"
license="Apache-2.0"
depends="
	mopidy
	py3-beautifulsoup4
	py3-cachetools
	py3-pykka
	py3-requests
	py3-setuptools
	yt-dlp
	"
checkdepends="
	py3-vcrpy
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/M/Mopidy-YouTube/Mopidy-YouTube-$pkgver.tar.gz"
options="!check" # Broken, https://github.com/natumbri/mopidy-youtube/issues/180
builddir="$srcdir/Mopidy-YouTube-$pkgver"

build() {
	python3 setup.py build
}

check() {
	# Disabled tests require a network connection
	pytest -k 'not test_list_playlists and not test_search and not test_list_videos and not test_list_playlistitems and not test_get_video'
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="
9640f19393d2a26bda94c16ca05fed2b129dc75fdce68d8c10ce133f4cbec94576ead5353ca11a36bcf5442150b590f5b96c4a40efd2acc4f2492261b8c2a108  Mopidy-YouTube-3.7.tar.gz
"
