# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=py3-saml2
pkgver=7.5.0
pkgrel=1
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="
d6d23e97b7517777bc196e8ada98966d293bc6e377ffccd7bf9d2610ea3a2e195324659be2d44ccdda9abbbc528b85dba44614f26904733fca47e67ac4ad926f  py3-saml2-7.5.0.tar.gz
"
