From dcfe95fbc2ff08f3ede9fc5b7ec22a475dbb64cd Mon Sep 17 00:00:00 2001 From: Oleg Titov Date: Sun, 19 Nov 2023 16:54:27 -0600 Subject: [PATCH] testing/py3-zimscraperlib: new aport Collection of python code to re-use across python-based scrapers https://github.com/openzim/python-scraperlib --- testing/py3-zimscraperlib/APKBUILD | 69 ++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 testing/py3-zimscraperlib/APKBUILD diff --git a/testing/py3-zimscraperlib/APKBUILD b/testing/py3-zimscraperlib/APKBUILD new file mode 100644 index 00000000000..6d884411ad9 --- /dev/null +++ b/testing/py3-zimscraperlib/APKBUILD @@ -0,0 +1,69 @@ +# Contributor: Oleg Titov +# Maintainer: Oleg Titov +pkgname=py3-zimscraperlib +pkgver=3.1.1 +pkgrel=0 +pkgdesc="Collection of python code to re-use across python-based scrapers" +url="https://github.com/openzim/python-scraperlib" +arch="noarch" +license="GPL-3.0-or-later" +depends=" + ffmpeg + gifsicle + py3-pillow + py3-six + wget + " +makedepends="py3-gpep517 py3-setuptools py3-wheel" +checkdepends=" + py3-babel + py3-beautifulsoup4 + py3-colorthief + py3-iso639 + py3-libzim + py3-lxml + py3-magic + py3-optimize-images + py3-piexif + py3-pytest + py3-pytest-cov + py3-pytest-httpbin + py3-resizeimage + py3-requests + py3-wsgiprox + yt-dlp-core + " +subpackages="$pkgname-pyc" +source="py3-zimscraperlib-$pkgver.tar.gz::https://github.com/openzim/python-scraperlib/archive/refs/tags/v$pkgver.tar.gz" +builddir="$srcdir/python-scraperlib-$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 + + # some tests may fail, so disable them + # https://github.com/openzim/python-scraperlib/issues/114 + .testenv/bin/python3 -m pytest \ + -k "not test_get_media_info[mp4-video.mp4-expected1]"` \ + `" and not test_reencode_media[video.mkv-video.mp4-ffmpeg_args0-expected0]"` \ + `" and not test_selocale_unsupported"` \ + `" and not test_installed_script" \ + --runslow --runinstalled \ + --cov=zimscraperlib \ + --cov-report=term --cov-report term-missing +} + +package() { + python3 -m installer -d "$pkgdir" \ + .dist/*.whl +} + +sha512sums=" +9cd5af499770cb73d4fcc99f3ee5484c95dd3355e7b56275075aa5aebd5cfd72d39750edb4c13a9647447bb11a2c13fe35f4ce6ad95fab0c022b398382c21efa py3-zimscraperlib-3.1.1.tar.gz +"