# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=py3-treq
pkgver=23.11.0
pkgrel=0
pkgdesc="py3-requests-like API build on top of Twisted's HTTP client"
url="https://github.com/twisted/treq"
arch="noarch"
license="MIT"
depends="python3 py3-incremental py3-requests py3-twisted py3-attrs"
makedepends="py3-setuptools py3-gpep517"
checkdepends="py3-httpbin py3-openssl py3-pytest py3-mock py3-service_identity py3-twisted-tests"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/twisted/treq/archive/refs/tags/release-$pkgver.tar.gz"
builddir="$srcdir/treq-release-$pkgver"

# note(Leo): Replace the GHSA with CVEs once it comes out
#
# secfixes:
#   22.1.0-r0:
#     - GHSA-fhpf-pp6p-55qc

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

check() {
	rm -f src/treq/test/test_treq_integration.py
	python3 -m pytest -k 'not test_text_content_unicode_headers'
}

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

sha512sums="
3e5feba73127d86f7cb3b98fee391cad954cff22fa2a7b67301fd792dfc5d83fd14d4df30cc42608c1ca3bbfc0dcbee985cdebae06a65df3a8d79a19283b0b9a  py3-treq-23.11.0.tar.gz
"
