# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer:
pkgname=py3-xarray
_pkgorig=xarray
pkgver=2024.11.0
pkgrel=0
pkgdesc="N-D labeled arrays and datasets in Python"
url="https://xarray.dev"
arch="noarch"
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"

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 and not test_doc_example'
}

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

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

sha512sums="
0f2d22391eb851b82b804ebd9404a9863143a9ca647fa0d52d9c1b421f94187739986e8c1205274840f46329478846802b11304c02c5dad58ae9ffc6062b1cec  py3-xarray-2024.11.0.tar.gz
"
