# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-cytoolz
_pkgorig=cytoolz
pkgver=0.12.3
pkgrel=1
pkgdesc="Cython implementation of Toolz: High performance functional utilities"
url="https://github.com/pytoolz/cytoolz"
arch="all"
license="BSD-3-Clause"
depends="python3 cython py3-toolz"
checkdepends="py3-pytest"
makedepends="python3-dev py3-setuptools"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/c/cytoolz/cytoolz-$pkgver.tar.gz
	do-not-package-tests.patch
	fix-test-inspect-wrapped-property.patch
	"
builddir="$srcdir/$_pkgorig-$pkgver"

build() {
	# C extension
	python3 setup.py build_ext --inplace --with-cython

	# Python extension
	python3 setup.py build
}

check() {
	local python_version=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
	export PYTHONPATH="build/lib.linux-$CARCH-$python_version/:$PYTHONPATH"
	echo "$PYTHONPATH"

	pytest -v
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="
b3c46182b1d93b4e862e8d37e7e49fd44126e7ce503b9a25f7d78ff79ee9eac938bf47a63fda6ff6adbb660efedf0eb07810fbc2e91d7a471cb0167bb7ef0ad6  py3-cytoolz-0.12.3.tar.gz
d5a79048e053efccec379e73a185bd8002ad95246b696a8c612bbb849e2b55f1c06e203ccc164f25b9a9242515805590c26028da188ac789ffe965b5a7430707  do-not-package-tests.patch
e386763f3f5c1af48c222f967f78952ba641e5f6cbb11d93e958c9c99ce7f2a6d6e74b8e61f6eb5250d52c25eb318ba7154cdf4a1edef0bc669e35cc70d1dcaf  fix-test-inspect-wrapped-property.patch
"
