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

_name=safehttpx
pkgname=python-$_name
pkgver=0.1.7
pkgrel=3
pkgdesc='A small Python library created to help developers protect their applications from Server Side Request Forgery (SSRF) attacks.'
arch=('any')
url='https://github.com/gradio-app/safehttpx'
license=('Apache-2.0')
depends=('python' 'python-httpx')
makedepends=('python-hatchling' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-pytest' 'python-pytest-asyncio')
source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz")
sha256sums=('db201c0978c41eddb8bb480f3eee59dd67304fdd91646035e9d9a720049a9d23')

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

check() {
  cd "$srcdir"/$_name-$pkgver
  local pytest_options=(
    -vv
    --disable-warnings
  )
  PYTHONPATH=$PWD pytest "${pytest_options[@]}" test/test.py
}

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