# Contributor: Eivind Uggedal <eu@eju.no>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-jwt
pkgver=2.8.0
pkgrel=1
pkgdesc="Python3 JSON Web Token implementation"
url="https://github.com/jpadilla/pyjwt"
license="MIT"
arch="noarch"
makedepends="py3-gpep517 py3-installer py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/jpadilla/pyjwt/archive/$pkgver/py3-jwt-$pkgver.tar.gz"
builddir="$srcdir/pyjwt-$pkgver"

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

# secfixes:
#   2.4.0-r0:
#     - CVE-2022-29217

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

check() {
	pytest
}

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

sha512sums="
9d631c20c5207d5ab3137c9d56825f9e197688181abae4f3d6aac766530a35e07a2dfd5e3ba6e530dd5a29a27f54e961cb01075f3bc831b73816aa7c357eb0d4  py3-jwt-2.8.0.tar.gz
"
