# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-pymsteams
pkgver=0.2.3
pkgrel=1
pkgdesc="Format messages and post to Microsoft Teams."
url="https://github.com/rveachkc/pymsteams"
arch="noarch"
license="Apache-2.0"
makedepends="py3-setuptools py3-gpep517"
checkdepends="py3-pytest py3-requests py3-py py3-pluggy"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/rveachkc/pymsteams/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir"/${pkgname/py3-/}-$pkgver
# httpstat.us is down
options="!check"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	export MS_TEAMS_WEBHOOK="https://localhost"
	.testenv/bin/python3 -m pytest -v -k "not test_message_size"
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
94ff30f53236e6e2586af47984abbe98884006ebe61b67f6d08aa59e32e94d37f5e6eaab0df155053ee6d08a953240a15782df04727495ab8e12eeffdcad4eac  py3-pymsteams-0.2.3.tar.gz
"
