# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-deprecated
pkgver=1.2.14
pkgrel=2
pkgdesc="Python @deprecated decorator to deprecate old python classes, functions or methods"
url="https://github.com/tantale/deprecated"
license=('MIT')
arch=('any')
depends=('python-wrapt')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-pytest')
source=("$pkgname-$pkgver.tar.gz::https://github.com/tantale/deprecated/archive/v$pkgver.tar.gz")
sha512sums=('dcf741dd9c237e461d700ada6ed12d048e953c0dd9ad9c9e8301dbec3f45ba70385d4e70337934fd8bcece4899e806a05202d8a90a030171279468ba86b95d2b')

build() {
  cd deprecated-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd deprecated-$pkgver
  pytest
}

package() {
  cd deprecated-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE.rst -t "$pkgdir"/usr/share/licenses/$pkgname/
}
