# Contributor: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Daniel M. Capella <polyzen@archlinux.org>
# Contributor: Michael Yeatts <mwyeatts@gmail.com>

pkgname=python-typing_extensions
pkgver=4.15.0
pkgrel=1
pkgdesc='Backported and Experimental Type Hints for Python 3.8+'
arch=(any)
url=https://github.com/python/typing_extensions
license=(Python-2.0.1)
depends=(python)
makedepends=(
  git
  python-build
  python-flit-core
  python-installer
)
checkdepends=(python-tests)
source=("$pkgname::git+$url.git#tag=$pkgver")
sha512sums=('471fd5003f8230c8e1b70515de6394f2273253eab577cece43012f81178ad2b08d6eaf90ead473b477349dc4dcbc3260e83dbf9aba54dfc5645a231a1e820654')
b2sums=('17f1071cd2fc5276c203ea14bf0de468d6238d59e5960b710d8a60cb3dec251f3b837ae7551f4373877aaba20a307d1d5333fd9650ea3743aee085e3a4adec4d')

build() {
  cd "$pkgname"
  python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
  cd "$pkgname"
  PYTHONPATH="$PWD/src" python -m unittest discover src
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
