# Contributor: Thomas Boerger <thomas@webhippie.de>
# Maintainer: omni <omni+alpine@hack.org>
maintainer="omni <omni+alpine@hack.org>"
pkgname=mycli
pkgver=1.28.0
pkgrel=0
pkgdesc="MySQL CLI with autocompletion and syntax highlighting"
url="https://www.mycli.net/"
arch="noarch"
license="BSD-3-Clause"
depends="
	python3
	py3-cli_helpers
	py3-click
	py3-configobj
	py3-cryptography
	py3-prompt_toolkit
	py3-pyaes
	py3-pyfzf
	py3-pygments
	py3-pymysql
	py3-pyperclip
	py3-sqlglot
	py3-sqlparse
	"
makedepends="python3-dev py3-gpep517 py3-paramiko py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-mock"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/m/mycli/mycli-$pkgver.tar.gz"

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

check() {
	# click 8.1 output differs
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -v test
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
	rm -rf "$pkgdir"/usr/lib/python3*/site-packages/test/
}

sha512sums="
b5859f6ba9365399945b5cb897c626942ae4cef229f1a7d2e5e3ce93f851290507de87d7526dbfc152495be8a3eee241dca5d4bb4312d9df593c89908e0e3264  mycli-1.28.0.tar.gz
"
