| 1 | # Contributor: Celeste <[email protected]> |
| 2 | # Maintainer: Wen Heping <[email protected]> |
| 3 | pkgname=lastversion |
| 4 | pkgver=3.6.12 |
| 5 | pkgrel=0 |
| 6 | pkgdesc="CLI tool to find the latest stable version of a project" |
| 7 | url="https://lastversion.getpagespeed.com/" |
| 8 | arch="noarch" |
| 9 | license="BSD-2-Clause" |
| 10 | depends=" |
| 11 | py3-appdirs |
| 12 | py3-beautifulsoup4 |
| 13 | py3-cachecontrol |
| 14 | py3-dateutil |
| 15 | py3-distro |
| 16 | py3-feedparser |
| 17 | py3-filelock |
| 18 | py3-packaging |
| 19 | py3-requests |
| 20 | py3-tqdm |
| 21 | py3-urllib3 |
| 22 | py3-yaml |
| 23 | " |
| 24 | makedepends=" |
| 25 | py3-gpep517 |
| 26 | py3-setuptools |
| 27 | py3-wheel |
| 28 | " |
| 29 | checkdepends="py3-pytest" |
| 30 | options="net" # tests require network access |
| 31 | subpackages="$pkgname-pyc" |
| 32 | source="https://github.com/dvershinin/lastversion/archive/v$pkgver/lastversion-$pkgver.tar.gz" |
| 33 | |
| 34 | build() { |
| 35 | gpep517 build-wheel \ |
| 36 | --wheel-dir .dist \ |
| 37 | --output-fd 3 3>&1 >&2 |
| 38 | } |
| 39 | |
| 40 | check() { |
| 41 | python3 -m venv --clear --without-pip --system-site-packages .testenv |
| 42 | .testenv/bin/python3 -m installer .dist/*.whl |
| 43 | |
| 44 | # Running the ignored tests will exceed Github's |
| 45 | # API rate limit for unauthenticated requests |
| 46 | PATH="$builddir/.testenv/bin:$PATH" \ |
| 47 | .testenv/bin/python3 -m pytest \ |
| 48 | --ignore tests/test_cli.py \ |
| 49 | --ignore tests/test_github.py \ |
| 50 | --ignore tests/test_hg.py \ |
| 51 | --ignore tests/test_lastversion.py |
| 52 | } |
| 53 | |
| 54 | package() { |
| 55 | python3 -m installer -d "$pkgdir" \ |
| 56 | .dist/*.whl |
| 57 | } |
| 58 | |
| 59 | sha512sums=" |
| 60 | a65e2089a4416d2449026e9b5e15cad6a083162754bb5edc56f6130ceeb9dfef0b733e8b3446d321775fc88f0b410b828ef86bb4852d34c6ae64b7de206080fa lastversion-3.6.12.tar.gz |
| 61 | " |