summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5fbe6f0668011d6187e3e34e5b4d219ee0769bff (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
# Maintainer: Mohamed Amine Zghal (medaminezghal) <medaminezghal at outlook dot com>

_name=runloop-api-client
pkgname=python-${_name//-/_}
pkgver=1.21.0
pkgrel=1
pkgdesc='The official Python library for the runloop API.'
arch=('any')
url='https://github.com/runloopai/api-client-python'
license=('MIT')
depends=('python' 'python-httpx' 'python-h2' 'python-pydantic' 'python-typing_extensions' 'python-anyio' 'python-distro' 'python-sniffio' 'python-uuid-utils')
makedepends=('python-hatchling' 'python-hatch-fancy-pypi-readme' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-respx' 'python-pytest' 'python-pytest-asyncio' 'python-pytest-timeout' 'python-time-machine' 'python-dirty-equals' 'python-rich' 'python-pytest-xdist' 'python-aiohttp' 'python-httpx-aiohttp' 'npm' 'nodejs')
optdepends=('python-aiohttp: aiohttp' 'python-httpx-aiohttp: aiohttp')
source=("$url/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('7337105c372d430c17ebbd7fe3c870a594300a898377d1c56e2349288d34ed57')

build() {
  cd "$srcdir"/${_name//runloop-/}-python-$pkgver
  python -m build --wheel --no-isolation --skip-dependency-check
}

check() {
  export DEFER_PYDANTIC_BUILD=false
  local pytest_options=(
    -vv
    --disable-warnings
    -p 'no:benchmark'
  )
  cd "$srcdir"/${_name//runloop-/}-python-$pkgver
  trap 'pkill -f steady' EXIT
  ./scripts/mock --daemon
  PYTHONPATH=$PWD/src pytest "${pytest_options[@]}" tests
}

package() {
  cd "$srcdir"/${_name//runloop-/}-python-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}