# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-softlayer
pkgver=6.2.5
pkgrel=0
pkgdesc="library for SoftLayer's API"
url="https://github.com/softlayer/softlayer-python"
arch="noarch"
license="MIT"
depends="py3-click py3-prompt_toolkit py3-prettytable3 py3-pygments py3-requests py3-rich py3-urllib3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-mock py3-testtools py3-softlayer-zeep python3-tkinter"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/softlayer/softlayer-python/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/softlayer-python-$pkgver"

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

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl

	rm -rf "$pkgdir"/usr/lib/python3*/site-packages/tests
}

sha512sums="
b4eb27fbb1ff5dd6aaf89608401d91431c2ad62ac77bfe7cb86ec162f211b1736d9c1bb800d048d16f0d3fe4e4dbc6e6feaae0c8a325eb0199858455a91f4e9a  py3-softlayer-6.2.5.tar.gz
"
