PKGBUILDs/community/python-awkward/PKGBUILD

70 lines
2.3 KiB
Bash
Raw Normal View History

2022-02-08 01:40:38 +00:00
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - remove cuda make/optdepends
# - move python-pyaml to makedepends
2022-03-24 00:47:04 +00:00
# - add python-setuptools to makedepends
2022-02-08 01:40:38 +00:00
_pkgname=awkward
pkgname="python-${_pkgname}"
2022-03-24 00:47:04 +00:00
pkgver=1.8.0
pkgrel=2
2022-02-08 01:40:38 +00:00
pkgdesc="Manipulate jagged, chunky, and/or bitmasked arrays as easily as Numpy"
2022-03-24 00:47:04 +00:00
url="https://github.com/scikit-hep/awkward-1.0"
2022-02-08 01:40:38 +00:00
license=('BSD')
arch=('x86_64')
2022-03-24 00:47:04 +00:00
depends=('python-numpy' 'python-packaging')
makedepends=('cmake' 'git' 'python-build' 'python-installer' 'python-wheel' 'python-pyaml' 'python-setuptools')
checkdepends=('python-pytest' 'python-pytest-cov' 'python-hist' 'python-pandas' 'python-numexpr' 'python-pyarrow' 'python-scikit-hep-testdata' 'python-vector'
'root' 'pybind11' 'rapidjson')
2022-02-08 01:40:38 +00:00
source=(
"${pkgname}::git+https://github.com/scikit-hep/${_pkgname}-1.0#tag=${pkgver}"
"${pkgname}-dlpack::git+https://github.com/dmlc/dlpack.git"
"${pkgname}-rapidjson::git+https://github.com/Tencent/rapidjson.git"
"${pkgname}-pybind11::git+https://github.com/pybind/pybind11.git"
)
sha512sums=('SKIP'
'SKIP'
'SKIP'
'SKIP')
get_pyver () {
python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))'
}
prepare() {
cd "${srcdir}/${pkgname}"
git submodule init
git config submodule."pybind11".url "${srcdir}/${pkgname}"-pybind11
git config submodule."rapidjson".url "${srcdir}/${pkgname}"-rapidjson
git config submodule."dlpack".url "${srcdir}/${pkgname}"-dlpack
git submodule update --init --recursive
2022-03-24 00:47:04 +00:00
sed '/cmake/d' -i pyproject.toml
sed \
-e 's/setuptools.extern.packaging.version.parse/packaging.version.parse/' \
-e 's/import setuptools/import packaging/' \
-i src/awkward/_v2/_util.py tests/test_0080-flatpandas-multiindex-rows-and-columns.py
2022-02-08 01:40:38 +00:00
}
build() {
cd "${pkgname}"
2022-03-24 00:47:04 +00:00
python -m build --wheel --no-isolation
2022-02-08 01:40:38 +00:00
}
check() {
cd "${pkgname}"
2022-03-24 00:47:04 +00:00
PYTHONPATH="build/lib.linux-${CARCH}-$(get_pyver)" pytest tests || echo 'some tests fail'
2022-02-08 01:40:38 +00:00
}
package() {
cd "${pkgname}"
2022-03-24 00:47:04 +00:00
python -m installer --destdir="$pkgdir" dist/*.whl
2022-02-08 01:40:38 +00:00
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/"${pkgname}"/LICENSE
cd "${pkgdir}/usr/lib/python$(get_pyver)/site-packages"
# ln -s awkward1 awkward
}