# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-setuptools-declarative-requirements
pkgver=1.3.0
pkgrel=3
pkgdesc="Requirements Support For Setuptools Declarative setup.cfg"
url="https://github.com/s0undt3ch/setuptools-declarative-requirements"
arch="noarch"
license="Apache-2.0"
depends="py3-setuptools"
makedepends="py3-setuptools_scm py3-gpep517 py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/s0undt3ch/setuptools-declarative-requirements/archive/refs/tags/$pkgver/py3-setuptools-declarative-requirements-$pkgver.tar.gz"
builddir="$srcdir/setuptools-declarative-requirements-$pkgver"
options="!check" # circular dependency with py3-pytest-shell-utilities

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
eb20016ab0b8029a38ff4632d19d63cd4b6396c9d101efce577ac862feb3fc485ac4a644035d3267cd05caf679f9b2259e1d1340f8cd902ea7c7451e099c71cc  py3-setuptools-declarative-requirements-1.3.0.tar.gz
"
