# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-poetry-plugin-export
pkgver=1.8.0
pkgrel=0
pkgdesc="Poetry plugin to export the dependencies to various formats"
url="https://github.com/python-poetry/poetry-plugin-export"
license="MIT"
arch="noarch"
# This plugin depends on poetry, but poetry depends on it as well.
# Poetry is therefore not listed to avoid a cyclic dependecy.
# See: https://github.com/python-poetry/poetry/pull/5980
makedepends="py3-gpep517 py3-installer py3-poetry-core"
checkdepends="py3-pytest py3-pytest-mock"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/python-poetry/poetry-plugin-export/archive/$pkgver.tar.gz
	pytest.patch
	"
builddir="$srcdir/poetry-plugin-export-$pkgver"
options="!check" # cyclic dependency on poetry

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
}

sha512sums="
ddaa4ed20601357648fe0187c50d033da5dfc37d66c96b67c83962a88825ec5b49c79b30e60f67c860d381e6ad0cbac084209af806561f50cdc779dcebacaf2b  py3-poetry-plugin-export-1.8.0.tar.gz
1bad78c40d1647b32bd2d111179f7f44195c0e606a24f26b87c4ebf3cc05730659a3ebe9ffcf09f9e698ac0421c8f90de58038940f41963bea93be610edc7e41  pytest.patch
"
