summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6b65a7be24ef33d519edaa310a6346cfcb846593 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Maintainer: Carl Smedstad <carl.smedstad at protonmail dot com>

pkgname=python-aiohttp-middlewares
_pkgname=${pkgname#python-}
pkgver=2.4.0
pkgrel=1
pkgdesc="Collection of useful middlewares for aiohttp.web applications"
arch=(any)
url="https://github.com/playpauseandstop/aiohttp-middlewares"
license=(BSD-3-Clause)
depends=(
  python
  python-aiohttp
  python-async-timeout
  python-attrs
  python-yarl
)
makedepends=(
  python-build
  python-installer
  python-poetry-core
  python-wheel
)
checkdepends=(
  python-pytest
  python-pytest-aiohttp
  python-pytest-asyncio
)
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('5828f8640b6f8701a07f57a4f52812105275c9dffb64395f27aa382c449a41a3')

build() {
  cd "$_pkgname-$pkgver"
  python -m build --wheel --no-isolation
}

check() {
  cd "$_pkgname-$pkgver"
  rm -rf tmp_install
  python -m installer --destdir=tmp_install dist/*.whl
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  export PYTHONPATH="$PWD/tmp_install/$site_packages"
  pytest --override-ini="addopts="
}

package() {
  cd "$_pkgname-$pkgver"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}