# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Keith Maxwell <keith.maxwell@gmail.com>
pkgname=py3-ruamel.yaml
_pyname=ruamel.yaml
# XXX: 0.17.29 rewrites tag handling, which breaks use widely
# if upgrading to a larger version, run the testsuite of aws-cli and borgmatic
# to verify it is functional.
pkgver=0.17.28
pkgrel=1
pkgdesc="Python YAML parser/emitter"
url="https://sourceforge.net/projects/ruamel-yaml/"
arch="noarch"
license="MIT"
replaces="py-ruamel py3-ruamel"
provides="py-ruamel=$pkgver-r$pkgrel py3-ruamel=$pkgver-r$pkgrel"
depends="py3-ruamel.yaml.clib"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest py3-ruamel.std.pathlib"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/r/$_pyname/$_pyname-$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"
options="!check" # tests are not included in the latest artifact on PyPI

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

check() {
	PYTHONPATH="$PWD/build/lib" pytest-3 \
		--deselect=_test/test_issues.py::TestIssues::test_issue_82 \
		--deselect=_test/test_issues.py::TestIssues::test_issue_220 \
		--deselect=_test/test_issues.py::TestIssues::test_issue_238 \
		--deselect=_test/test_yamlobject.py::test_monster \
		--deselect=_test/test_yamlobject.py::test_qualified_name00 \
		_test/test_*.py
}

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

sha512sums="
5195485270b7a66b228ccfa2956b172cd97712e950f148620d8fb17ba9bf4548a3328229308ffffe970e30fcc73b28ea0ebd2ac571691bc26f1620bcb3183dbe  ruamel.yaml-0.17.28.tar.gz
"
