# Contributor: Eivind Uggedal <eu@eju.no>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-jwt
pkgver=2.10.1
pkgrel=0
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="
9fc11a70960122799280669634bfeb9035222b9bda01eb31219d8f9a16d016a70617472ccd6873ceccc2124112dabfe160933d8eb24a096c14940625909dbe65  py3-jwt-2.10.1.tar.gz
"
