# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-httpcore
pkgver=1.0.5
pkgrel=0
pkgdesc="Minimal HTTP client"
url="https://www.encode.io/httpcore/"
license="BSD-3-Clause"
arch="noarch"
depends="
	python3
	py3-anyio
	py3-certifi
	py3-h11
	py3-sniffio
	"
makedepends="py3-gpep517 py3-hatchling"
checkdepends="
	py3-h2
	py3-hpack
	py3-hyperframe
	py3-pytest
	py3-pytest-httpbin
	py3-pytest-trio
	py3-socksio
	"
subpackages="$pkgname-pyc"
source="https://github.com/encode/httpcore/archive/$pkgver/py3-httpcore-$pkgver.tar.gz
	remove-fancy-pypi-readme.patch
	"
builddir="$srcdir/httpcore-$pkgver"

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

check() {
	PYTHONPATH="$PWD/build/lib" pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/httpcore-$pkgver-py3-none-any.whl
}

sha512sums="
4b37f3874e65908598b906167d5b0840f66ffef95b65110d318d9e64df5fd23770a08ea44ea2f3cf6f9db50f20bb9fec99b40323b959675b37168414cf397bf8  py3-httpcore-1.0.5.tar.gz
ed30ba9568defdf3c9f5e821c576b1f1b088b3819d9f430049af68cace0e874278c7f75cafc446a7e9c0e39f7a9fbe12de11bce022b06ce2bce67e51952c3f8e  remove-fancy-pypi-readme.patch
"
