summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 17c0b06f8c9f32f6d591c847987c1e4565ac894d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Maintainer: BrainDamage

pkgname=python-metpy
pkgver=1.3.1
pkgrel=1
_basename="MetPy"
_dirname="${_basename}-${pkgver}"
pkgdesc="collection of tools in Python for reading, visualizing and performing calculations with weather data."
arch=(any)
url="https://unidata.github.io/MetPy"
license=('BSD')
depends=('python' 'python-matplotlib' 'python-numpy' 'python-scipy'
	'python-pandas' 'python-pint' 'python-pooch' 'python-xarray'
	'python-pyproj' 'python-traitlets')
optdepends=('python-cartopy: for the examples' 'python-shapely: for the examples')
makedepends=('python-setuptools' 'python-setuptools-scm')
# documentation dependencies
#makedepends+=('python-sphinx' 'python-sphinx-gallery' 'python-myst-parser' 'python-netcdf4')
checkdepends=('python-pytest' 'python-pytest-mpl' 'python-cartopy' 'python-shapely' 'python-netcdf4')
source=("${pkgname}-${pkgver}::https://github.com/Unidata/${_basename}/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('3739e8089ed978ae20eaea673fe3ab95948be1329cdc0a3b4c91c7d7c3d1cf96')

build() {
	cd "${srcdir}/${_dirname}"
	export SETUPTOOLS_SCM_PRETEND_VERSION="${pkgver}"
	export PYTHONHASHSEED=0
	python setup.py build
}


package() {
	cd "${srcdir}/${_dirname}"
	python setup.py install --optimize=1 --skip-build --root="${pkgdir}/" --prefix="/usr"
	# not necessary for every package, but for those who it is, it'd generate conflict with others otherwise
	rm -rf "${pkgdir}/$(python -c 'import site; print(site.getsitepackages()[0])')/tests/"
}


check() {
	cd "${srcdir}/${_dirname}"
	# we need to prepend system's installation because the package is dumb and would otherwise override the io core module by name collision
	export PYTHONPATH="$(python -c 'import sys; print(":".join(sys.path))'):${srcdir}/${_dirname}/build/lib/${_basename,,}"
	pytest
}