# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer:
pkgname=py3-xarray
_pkgorig=xarray
pkgver=2024.3.0
pkgrel=1
pkgdesc="N-D labeled arrays and datasets in Python"
url="https://xarray.dev"
arch="noarch !s390x" # assertionErrors
license="Apache-2.0"
depends="python3 py3-numpy py3-packaging py3-pandas"
makedepends="py3-gpep517 py3-setuptools_scm py3-wheel"
checkdepends="py3-coverage py3-mock py3-pytest-xdist py3-pytest-cov"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/x/xarray/xarray-$pkgver.tar.gz"
builddir="$srcdir/$_pkgorig-$pkgver"
options="!check" # some tests are failing in this release | temporary fix

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 -n auto -k 'not test_dataset and not test_distributed and not test_dataarray and not test_accessor_str and not test_missing and not test_groupby_dims_property'
}

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

	rm -r "$pkgdir"/usr/lib/python3.*/site-packages/xarray/tests
}

sha512sums="
4c7490b2efb4ed1a7278c807f4d200d99407d21bd54287ca5d35300194049a82aef3d8fbedba8f180ddb0d554cbb3f8f63abbb01401d5904f6d29cfa729e2ab0  py3-xarray-2024.3.0.tar.gz
"
