# Maintainer: Noel Kuntze <noel.kuntze@contauro.com>
pkgname=py3-falcon
pkgdesc="Web API framework for fast and reliable microservices, proxies, and app backends"
pkgver=4.0.2
pkgrel=1
arch="all"
url="https://falconframework.org/"
license="Apache-2.0"
depends="python3"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	cython
	"
checkdepends="
	py3-coverage
	py3-pytest
	py3-pyaml
	py3-requests
	py3-pytest-asyncio
	py3-aiofiles
	py3-httpx
	py3-websockets
	py3-cbor2
	py3-msgpack
	py3-mujson
	py3-ujson
	py3-rapidjson
	py3-orjson
	py3-gunicorn
	py3-daphne
	py3-waitress
	"

subpackages="$pkgname-pyc"

source="$pkgname-$pkgver.tar.gz::https://github.com/falconry/falcon/archive/refs/tags/$pkgver.tar.gz
	cf51816a2f7cd7a23d3e1129fe9418a5fc85d8be.patch
	f5920fea1cea39fb2a1ce3fdee3ea335532f5ac4.patch
	"

builddir="$srcdir"/falcon-$pkgver

build() {
	gpep517 build-wheel \
		--wheel-dir dist \
		--output-fd 3 3>&1 >&2
}

check() {
	local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
	python3 -m installer -d test_dir dist/*.whl
	export PYTHONPATH="$PWD/test_dir/$_site_packages:$PYTHONPATH"
	pytest -vv tests/
}

package() {
	python3 -m installer -d "$pkgdir" dist/*.whl
}

sha512sums="
48f13834f9ba5829aa7050a6c86839533332c47282f12dc96d3d2f82a67f7a53878bf5f96b249bd79f5985eb1e2bde94ad246c2d0f3e1deebb4c04f364a23ac4  py3-falcon-4.0.2.tar.gz
754933c349d3295f2b3b75b72396d558615390657741ff78d0ca368cddd15063ffc1e080b9de27464e54a3e15b80ea80ee4500df43e59a79047e5b4a2d52cd43  cf51816a2f7cd7a23d3e1129fe9418a5fc85d8be.patch
131305d6cab2169f52cbbfe25f51b539c42ba95579549465aefa9e9aa0489065e33b98c9220845f3e91b941caa8b6a508473a8f77c38074ea080773641afd8cf  f5920fea1cea39fb2a1ce3fdee3ea335532f5ac4.patch
"
