PKGBUILDs/extra/python-awkward/PKGBUILD

93 lines
3.4 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
2024-05-02 13:12:58 +00:00
# - move python-pyaml, pybind11 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
2022-11-23 02:13:20 +00:00
pkgbase="python-${_pkgname}"
2024-04-27 15:58:15 +00:00
# pkgname=("${pkgbase}" "${pkgbase}-docs") - docs require many new dependencies
pkgname=$pkgbase
pkgver=2.6.3
pkgrel=1
2022-02-08 01:40:38 +00:00
pkgdesc="Manipulate jagged, chunky, and/or bitmasked arrays as easily as Numpy"
2022-09-05 22:18:21 +00:00
url="https://github.com/scikit-hep/awkward"
2022-02-08 01:40:38 +00:00
license=('BSD')
arch=('x86_64')
2022-11-23 02:13:20 +00:00
depends=('python-numpy' 'python-packaging' 'python-importlib_resources')
optdepends=('python-pyarrow: pyArrow connector'
'python-numexpr: numexpr connector'
'python-pandas: pandas connector')
2024-05-02 13:12:58 +00:00
makedepends=('cmake' 'git' 'python-build' 'python-installer' 'python-hatchling' 'doxygen' 'python-sphinx' 'python-sphinx_rtd_theme' 'python-hatch-fancy-pypi-readme' 'python-scikit-build-core' 'python-nox' 'python-pyaml' 'pybind11' 'python-setuptools')
2022-03-24 00:47:04 +00:00
checkdepends=('python-pytest' 'python-pytest-cov' 'python-hist' 'python-pandas' 'python-numexpr' 'python-pyarrow' 'python-scikit-hep-testdata' 'python-vector'
2024-05-02 13:12:58 +00:00
'root' 'rapidjson' 'python-fsspec')
2022-02-08 01:40:38 +00:00
source=(
2022-09-05 22:18:21 +00:00
"${pkgname}::git+https://github.com/scikit-hep/${_pkgname}#tag=v${pkgver}"
2022-02-08 01:40:38 +00:00
"${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"
)
2024-04-27 15:58:15 +00:00
sha512sums=('a1ac20198307e3a3188f0d8643dd527ef99ae1c913a8762a8a533c73e2597abae5d7c173eb7602ed2c169595ce9199679d18c329f76d6c2e568a53616ee742b3'
2022-02-08 01:40:38 +00:00
'SKIP'
'SKIP'
'SKIP')
get_pyver () {
python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))'
}
prepare() {
2022-11-23 02:13:20 +00:00
cd "${srcdir}/${pkgbase}"
2022-02-08 01:40:38 +00:00
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
2022-11-23 02:13:20 +00:00
git -c protocol.file.allow=always submodule update --init --recursive
2022-03-24 00:47:04 +00:00
sed '/cmake/d' -i pyproject.toml
2022-02-08 01:40:38 +00:00
}
build() {
2022-11-23 02:13:20 +00:00
cd "${srcdir}/${pkgbase}"
2024-04-27 15:58:15 +00:00
nox -s prepare
python -m build --wheel --no-isolation
cd awkward-cpp
2022-03-24 00:47:04 +00:00
python -m build --wheel --no-isolation
2022-02-08 01:40:38 +00:00
}
check() {
2022-11-23 02:13:20 +00:00
cd "${srcdir}/${pkgbase}"
2024-04-27 15:58:15 +00:00
python -m venv --system-site-packages test-env
test-env/bin/python -m installer dist/*.whl
test-env/bin/python -m installer awkward-cpp/dist/*.whl
cd tests
../test-env/bin/python -m pytest || echo 'some tests fail'
2022-02-08 01:40:38 +00:00
}
2022-11-23 02:13:20 +00:00
package_python-awkward() {
optdepends+=("${pkgbase}-docs: docs")
cd "${srcdir}/${pkgbase}"
python -m installer --destdir="${pkgdir}" dist/*.whl
install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/"${pkgname}"/LICENSE
2024-04-27 15:58:15 +00:00
cd awkward-cpp
python -m installer --destdir="${pkgdir}" dist/*.whl
2022-11-23 02:13:20 +00:00
}
package_python-awkward-docs() {
cd "${srcdir}/${pkgbase}"
install -D LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -D README.md "${pkgdir}/usr/share/${pkgbase}/README.md"
2024-04-27 15:58:15 +00:00
python -m installer --destdir=tmp-install dist/*.whl
python -m installer --destdir=tmp-install awkward-cpp/dist/*.whl
2022-11-23 02:13:20 +00:00
install -d "${pkgdir}/usr/share/doc/${pkgbase}"
2024-04-27 15:58:15 +00:00
PYTHONPATH="${PWD}"/tmp-install/`python -c 'import site; print(site.getsitepackages()[0])'` sphinx-build "${PWD}/docs" "${pkgdir}/usr/share/doc/${pkgbase}"
2022-02-08 01:40:38 +00:00
}