# Contributor: Leo <thinkabit.ukim@gmail.com>
maintainer="fossdd <fossdd@pwned.life>"
pkgname=py3-saml2
pkgver=7.5.2
pkgrel=0
pkgdesc="Pure python implementation of SAML2"
url="https://github.com/IdentityPython/pysaml2"
arch="noarch"
license="Apache-2.0"
depends="
	python3
	py3-cryptography
	py3-defusedxml
	py3-openssl
	py3-dateutil
	py3-tz
	py3-requests
	py3-xmlschema
	xmlsec
	"
makedepends="
	py3-gpep517
	py3-poetry-core
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/IdentityPython/pysaml2/archive/v$pkgver.tar.gz"
builddir="$srcdir/pysaml2-$pkgver"
options="!check" # py3-mongo in testing

# secfixes:
#   6.5.0-r0:
#     - CVE-2021-21238
#     - CVE-2021-21239

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
}

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

sha512sums="
5be63cf1eb29cce3970471b9ebf36cc50ce241ae913da00bb9a42c9a96102e99d6f3ecb8839b4b09c88a2591b257219bfcc57562c630b0cf858b97b2e20a7c57  py3-saml2-7.5.2.tar.gz
"
