_pkgname=slidcord
pkgname="$_pkgname-git"
pkgver=r270.f2db4b7
pkgrel=1
pkgdesc='A feature-rich Discord to XMPP gateway'
arch=('x86_64' 'armv7h' 'aarch64')
url="https://slidge.im/docs/slidcord/main/"
license=('AGPL3')
depends=('python' 'python-slidge-git' 'python-emoji')
makedepends=('git' 'python-build' 'python-installer' 'python-wheel' 'python-setuptools')
source=('git+https://codeberg.org/slidge/slidcord')
sha256sums=('SKIP')

pkgver() {
  cd $_pkgname
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

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

package() {
  cd $_pkgname
  python -m installer --destdir="$pkgdir" dist/*.whl
}

check(){
    cd $_pkgname

    # Builtin unittest
    python -m unittest discover -v

    # For nosetests
    nosetests

    # For pytest
    pytest
}
