# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py3-parsing
_pkgname=pyparsing
pkgver=3.2.3
pkgrel=0
pkgdesc="Object-oriented approach to text processing"
url="https://github.com/pyparsing/pyparsing"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-flit-core py3-gpep517"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	skip-railroad.patch
	"
builddir="$srcdir"/$_pkgname-$pkgver

replaces="py-parsing" # Backwards compatibility
provides="py-parsing=$pkgver-r$pkgrel" # Backwards compatibility

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

check() {
	python3 -m venv --clear --without-pip --system-site-packages test-env
	test-env/bin/python3 -m installer .dist/*.whl
	# no pytest yet
	test-env/bin/python3 -m unittest -b \
		tests/test_simple_unit.py \
		tests/test_unit.py \
		tests/test_examples.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/pyparsing-$pkgver-py3-none-any.whl
}

sha512sums="
ef01403a158f15215b3be7f7c4aad2ceb6020d578dac68351b732df3447c685aa478d23ab645d554070ad2aec14ee565a0407f428b91f398e4429c0e53eb4a6d  pyparsing-3.2.3.tar.gz
e8ae66707d5278d11c26c9cf0da8e68897187589bdf8eaba74462eebe298e33cbebd69da75dcc9f5452b11d2d077a937fa7b469ee1688c4ff18c0dc0bef3b200  skip-railroad.patch
"
