# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Felix Yan <felixonmars@archlinux.org>

pkgname=python-pyjwt
pkgver=2.8.0
pkgrel=2
pkgdesc='JSON Web Token implementation in Python'
arch=(any)
url=https://github.com/jpadilla/pyjwt
license=(MIT)
depends=(python)
makedepends=(
  git
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(
  python-cryptography
  python-pytest
)
_tag=72ad55f6d7041ae698dc0790a690804118be50fc
source=(git+https://github.com/jpadilla/pyjwt.git#tag=${_tag})
b2sums=(SKIP)

prepare() {
  cd pyjwt
  git cherry-pick -n fbd40eb0603c64434293836c3a55852610116217 # python 3.12
}

pkgver() {
  cd pyjwt
  git describe --tags
}

build() {
  cd pyjwt
  python -m build -wn
}

check() {
  cd pyjwt
  pytest
}

package() {
  python -m installer -d "${pkgdir}" pyjwt/dist/*.whl
  install -Dm 644 pyjwt/LICENSE -t "${pkgdir}"/usr/share/licenses/python-pyjwt/
}

# vim: ts=2 sw=2 et:
