extra/python-awkward to 2.6.3-1

This commit is contained in:
Kevin Mihelich 2024-04-27 15:58:15 +00:00
parent d6112732ca
commit 7fd1c89207
2 changed files with 76 additions and 13 deletions

View file

@ -0,0 +1,54 @@
pkgbase = python-awkward
pkgdesc = Manipulate jagged, chunky, and/or bitmasked arrays as easily as Numpy
pkgver = 2.6.3
pkgrel = 1
url = https://github.com/scikit-hep/awkward
arch = x86_64
license = BSD
checkdepends = python-pyaml
checkdepends = python-pytest
checkdepends = python-pytest-cov
checkdepends = python-hist
checkdepends = python-pandas
checkdepends = python-numexpr
checkdepends = python-pyarrow
checkdepends = python-scikit-hep-testdata
checkdepends = python-vector
checkdepends = root
checkdepends = pybind11
checkdepends = rapidjson
checkdepends = python-fsspec
makedepends = cmake
makedepends = git
makedepends = python-build
makedepends = python-installer
makedepends = python-hatchling
makedepends = cuda
makedepends = doxygen
makedepends = python-sphinx
makedepends = python-sphinx_rtd_theme
makedepends = python-hatch-fancy-pypi-readme
makedepends = python-scikit-build-core
makedepends = python-nox
depends = python-numpy
depends = python-packaging
depends = python-importlib_resources
optdepends = cuda: CUDA support
optdepends = python-pyarrow: pyArrow connector
optdepends = python-numexpr: numexpr connector
optdepends = python-pandas: pandas connector
source = python-awkward::git+https://github.com/scikit-hep/awkward#tag=v2.6.3
source = python-awkward-dlpack::git+https://github.com/dmlc/dlpack.git
source = python-awkward-rapidjson::git+https://github.com/Tencent/rapidjson.git
source = python-awkward-pybind11::git+https://github.com/pybind/pybind11.git
sha512sums = a1ac20198307e3a3188f0d8643dd527ef99ae1c913a8762a8a533c73e2597abae5d7c173eb7602ed2c169595ce9199679d18c329f76d6c2e568a53616ee742b3
sha512sums = SKIP
sha512sums = SKIP
sha512sums = SKIP
pkgname = python-awkward
optdepends = cuda: CUDA support
optdepends = python-pyarrow: pyArrow connector
optdepends = python-numexpr: numexpr connector
optdepends = python-pandas: pandas connector
optdepends = python-awkward-docs: docs

View file

@ -7,9 +7,10 @@
_pkgname=awkward _pkgname=awkward
pkgbase="python-${_pkgname}" pkgbase="python-${_pkgname}"
pkgname=("${pkgbase}" "${pkgbase}-docs") # pkgname=("${pkgbase}" "${pkgbase}-docs") - docs require many new dependencies
pkgver=1.10.2 pkgname=$pkgbase
pkgrel=2 pkgver=2.6.3
pkgrel=1
pkgdesc="Manipulate jagged, chunky, and/or bitmasked arrays as easily as Numpy" pkgdesc="Manipulate jagged, chunky, and/or bitmasked arrays as easily as Numpy"
url="https://github.com/scikit-hep/awkward" url="https://github.com/scikit-hep/awkward"
license=('BSD') license=('BSD')
@ -18,9 +19,9 @@ depends=('python-numpy' 'python-packaging' 'python-importlib_resources')
optdepends=('python-pyarrow: pyArrow connector' optdepends=('python-pyarrow: pyArrow connector'
'python-numexpr: numexpr connector' 'python-numexpr: numexpr connector'
'python-pandas: pandas connector') 'python-pandas: pandas connector')
makedepends=('cmake' 'git' 'python-build' 'python-installer' 'python-wheel' 'doxygen' 'python-sphinx' 'python-sphinx_rtd_theme' 'python-pyaml' 'python-setuptools') 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' 'python-setuptools')
checkdepends=('python-pytest' 'python-pytest-cov' 'python-hist' 'python-pandas' 'python-numexpr' 'python-pyarrow' 'python-scikit-hep-testdata' 'python-vector' checkdepends=('python-pytest' 'python-pytest-cov' 'python-hist' 'python-pandas' 'python-numexpr' 'python-pyarrow' 'python-scikit-hep-testdata' 'python-vector'
'root' 'pybind11' 'rapidjson') 'root' 'pybind11' 'rapidjson' 'python-fsspec')
source=( source=(
"${pkgname}::git+https://github.com/scikit-hep/${_pkgname}#tag=v${pkgver}" "${pkgname}::git+https://github.com/scikit-hep/${_pkgname}#tag=v${pkgver}"
"${pkgname}-dlpack::git+https://github.com/dmlc/dlpack.git" "${pkgname}-dlpack::git+https://github.com/dmlc/dlpack.git"
@ -28,7 +29,7 @@ source=(
"${pkgname}-pybind11::git+https://github.com/pybind/pybind11.git" "${pkgname}-pybind11::git+https://github.com/pybind/pybind11.git"
) )
sha512sums=('SKIP' sha512sums=('a1ac20198307e3a3188f0d8643dd527ef99ae1c913a8762a8a533c73e2597abae5d7c173eb7602ed2c169595ce9199679d18c329f76d6c2e568a53616ee742b3'
'SKIP' 'SKIP'
'SKIP' 'SKIP'
'SKIP') 'SKIP')
@ -48,21 +49,25 @@ prepare() {
git -c protocol.file.allow=always submodule update --init --recursive git -c protocol.file.allow=always submodule update --init --recursive
sed '/cmake/d' -i pyproject.toml 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
} }
build() { build() {
cd "${srcdir}/${pkgbase}" cd "${srcdir}/${pkgbase}"
nox -s prepare
python -m build --wheel --no-isolation
cd awkward-cpp
python -m build --wheel --no-isolation python -m build --wheel --no-isolation
} }
check() { check() {
cd "${srcdir}/${pkgbase}" cd "${srcdir}/${pkgbase}"
local python_version=$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))') python -m venv --system-site-packages test-env
PYTHONPATH="$PWD/build/lib.linux-$CARCH-cpython-${python_version}" pytest || echo 'some tests fail' 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'
} }
package_python-awkward() { package_python-awkward() {
@ -70,6 +75,8 @@ package_python-awkward() {
cd "${srcdir}/${pkgbase}" cd "${srcdir}/${pkgbase}"
python -m installer --destdir="${pkgdir}" dist/*.whl python -m installer --destdir="${pkgdir}" dist/*.whl
install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/"${pkgname}"/LICENSE install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/"${pkgname}"/LICENSE
cd awkward-cpp
python -m installer --destdir="${pkgdir}" dist/*.whl
} }
package_python-awkward-docs() { package_python-awkward-docs() {
@ -78,6 +85,8 @@ package_python-awkward-docs() {
install -D LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" install -D LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -D README.md "${pkgdir}/usr/share/${pkgbase}/README.md" install -D README.md "${pkgdir}/usr/share/${pkgbase}/README.md"
python -m installer --destdir=tmp-install dist/*.whl
python -m installer --destdir=tmp-install awkward-cpp/dist/*.whl
install -d "${pkgdir}/usr/share/doc/${pkgbase}" install -d "${pkgdir}/usr/share/doc/${pkgbase}"
PYTHONPATH="${PWD}/build/lib" sphinx-build "${PWD}/docs-sphinx" "${pkgdir}/usr/share/doc/${pkgbase}" PYTHONPATH="${PWD}"/tmp-install/`python -c 'import site; print(site.getsitepackages()[0])'` sphinx-build "${PWD}/docs" "${pkgdir}/usr/share/doc/${pkgbase}"
} }