# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=python-sphinx-issues
_pyname=${pkgname/python-/}
pkgver=5.0.1
pkgrel=1
pkgdesc="Sphinx extension for linking to your project's issue tracker"
url='https://github.com/sloria/sphinx-issues'
arch=('any')
license=('MIT')
depends=('python' 'python-sphinx')
makedepends=('python-build' 'python-installer' 'python-flit-core')
checkdepends=('python-pytest')
source=(https://github.com/sloria/sphinx-issues/archive/${pkgver}/${_pyname}-${pkgver}.tar.gz)
sha512sums=('5b846525e6464c095bc5579a01bbd94ae6650cd2f6055c77910115bf60114a674ab8614ad5320186b9658616e629dd45b085081f7c9b585d6b2c85ea228ceee6')

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

check() {
  cd ${_pyname}-${pkgver}
  python -m installer --destdir=tmp-install dist/*.whl
  PYTHONPATH="$PWD"/tmp-install`python -c "import site; print(site.getsitepackages()[0])"` \
  py.test -v
}

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

# vim: ts=2 sw=2 et:
