# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>"
maintainer="Will Sinatra <wpsinatra@gmail.com>"
pkgname=py3-seaborn
_pkgorig=seaborn
pkgver=0.13.2
pkgrel=2
pkgdesc="Statistical data visualization in Python"
url="https://github.com/mwaskom/seaborn"
arch="noarch"
license="BSD-3-Clause"
depends="python3 py3-numpy py3-pandas py3-matplotlib py3-scipy py3-statsmodels"
makedepends="py3-gpep517 py3-flit-core"
checkdepends="py3-pytest-xdist"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/mwaskom/seaborn/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgorig-$pkgver"

#FIXME: 4 tests fail, check logic needs to be extended.
case "$CARCH" in
ppc64le)
	options="$options !check"
	;;
esac

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

check() {
	# FIXME: 2 lowess tests failed with
	# ImportError: numpy.core.multiarray failed to import

	pytest -n $JOBS \
		--deselect tests/test_regression.py::TestRegressionPlotter::test_lowess_regression \
		--deselect tests/test_regression.py::TestRegressionPlots::test_residplot_lowess \
		-k 'not test_categorical and not test_distributions and not test_axisgrid' # a minor portion of tests is failing (e.g. assertionErrors)
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/seaborn-$pkgver-py3-none-any.whl
}

sha512sums="
4027d6d37f9e3162d669b211ff6f0548a7983b48337831ca649da4196004345c8786fbe961f04091b2ddc04dda8355e8fe1b86a40be9c9d0a4de2fd35b0a1ef6  py3-seaborn-0.13.2.tar.gz
"
