# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-fixtures
pkgver=4.1.0
pkgrel=2
pkgdesc="Fixtures, reusable state for writing clean tests and more."
url="https://pypi.org/project/fixtures/"
arch="noarch"
license="MIT"
depends="
	py3-pbr
	python3
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-mock
	py3-testtools
	"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/f/fixtures/fixtures-$pkgver.tar.gz"
builddir="$srcdir/fixtures-$pkgver"
options="!check" # py3-testtools depends on this

replaces="py-fixtures" # Backwards compatibility
provides="py-fixtures=$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 .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m testtools.run
}

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

sha512sums="
6897449fdefd07abe7714186b366fdf4505283f6747f8fa4d17044bc45da58eb36e69d89381527ccecb98e6c62c58bc6d4f558af41cbfc87b0221ae60ba71ff6  fixtures-4.1.0.tar.gz
"
