# Contributor: Anjandev Momi <anjan@momi.ca>
# Maintainer: Anjandev Momi <anjan@momi.ca>
pkgname=flexget
pkgver=3.3.37
pkgrel=3
pkgdesc="Multipurpose automation tool for downloading media content from different sources"
url="https://flexget.com/"
arch="noarch"
license="MIT"
depends="
	python3
	py3-apscheduler
	py3-beautifulsoup4
	py3-cherrypy
	py3-click
	py3-colorama
	py3-colorclass
	py3-dateutil
	py3-feedparser
	py3-flask
	py3-flask-compress
	py3-flask-cors
	py3-flask-login
	py3-flask-restful
	py3-flask-restx
	py3-guessit
	py3-html5lib
	py3-jinja2
	py3-jsonschema
	py3-loguru
	py3-more-itertools
	py3-packaging
	py3-psutil
	py3-pynzb
	py3-parsing
	py3-pyrss2gen
	py3-rebulk
	py3-requests
	py3-rich
	py3-rpyc
	py3-sqlalchemy
	py3-terminaltables
	py3-yaml
	py3-zxcvbn
	"
makedepends="py3-setuptools py3-gpep517 py3-installer py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Flexget/Flexget/releases/download/v$pkgver/FlexGet-$pkgver.tar.gz"
builddir="$srcdir/FlexGet-$pkgver"
options="!check"

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

check() {
	PYTHONPATH="$PWD" pytest flexget/tests
}

package() {
	python3 -m installer --destdir="$pkgdir" .dist/*.whl
	rm -r "$pkgdir"/usr/lib/python*/site-packages/flexget/tests
}

sha512sums="
e1bd7c800f83b14a824dac0533bbd5bfe1cce1c5aa81d821b3b73641d7ef6b6e6fc1e3376ab25dde8e8e023b42e9ce4f834e941a81a9ccf2b123a78409cad675  flexget-3.3.37.tar.gz
"
