# Contributor: <xmingske@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-gunicorn
_pkgname=gunicorn
pkgver=23.0.0
pkgrel=0
pkgdesc="WSGI HTTP Server for UNIX"
url="https://gunicorn.org/"
arch="noarch"
license="MIT"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-cov py3-aiohttp py3-gevent"
subpackages="$pkgname-pyc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/benoitc/gunicorn/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

replaces=py-gunicorn # Backwards compatibility
provides=py-gunicorn=$pkgver-r$pkgrel # Backwards compatibility

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

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest \
		--deselect tests/workers/test_geventlet.py
}

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

sha512sums="
1304f348270134a5d9da0d6598f4878a25b3dd7ff96dc9eee1c07ec1031c03cd8bb3de42b6dedf63702588c7e482b18f88a3115e73005bbc4eaaad147d9674ba  gunicorn-23.0.0.tar.gz
"
