summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 098b631ba6f617b0ea8e2ad07d44cfde6903415f (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Maintainer: Jakub Klinkovský <lahwaacz at archlinux dot org>
# Contributor: Felix Yan <felixonmars@archlinux.org>
# Contributor: Konstantin Gizdov <arch at kge dot pw>

_name=awkward
pkgbase=python-$_name
# pkgname=($pkgbase $pkgbase-docs) - docs require many new dependencies
pkgname=$pkgbase
pkgver=2.9.0
pkgrel=2
pkgdesc="Manipulate jagged, chunky, and/or bitmasked arrays as easily as Numpy"
url="https://github.com/scikit-hep/awkward"
license=(BSD-3-Clause)
arch=(x86_64)
depends=(
  glibc
  libgcc
  libstdc++
  python
  python-fsspec
  python-numpy
  python-packaging
  python-typing_extensions
)
makedepends=(
  cmake
  cuda
  doxygen
  git
  python-build
  python-hatch-fancy-pypi-readme
  python-hatchling
  python-installer
  python-nox
  python-scikit-build-core
  python-sphinx
  python-sphinx_rtd_theme
)
checkdepends=(
  pybind11
  python-hist
  python-numba
  python-numexpr
  python-pandas
  python-pyaml
  python-pyarrow
  python-pytest
  python-scikit-hep-testdata
  python-vector
  root
)
optdepends=(
  'cuda: CUDA support'
  'python-numba: for using in Numba JIT functions'
  'python-numexpr: numexpr connector'
  'python-pandas: pandas connector'
  'python-pyarrow: pyArrow connector'
  'root: rdataframe connector'
)
source=(
  $pkgname::git+https://github.com/scikit-hep/$_name#tag=v$pkgver
  $pkgname-rapidjson::git+https://github.com/Tencent/rapidjson.git
)

sha512sums=('89830474bc37997f7493a7bf82d6eaaf7eac3674e7cf51847764b5d4db85026688a1ebf2b1012c6f5f7d75cba3200d915f45e4f73da694e8f1687bbca3eec91f'
            'SKIP')

prepare() {
  cd $pkgbase
  git submodule init

  git config submodule."rapidjson".url "$srcdir"/$pkgname-rapidjson

  git -c protocol.file.allow=always submodule update --init --recursive
}

build() {
  cd $pkgbase

  nox -s prepare
  python -m build --wheel --no-isolation

  cd awkward-cpp
  python -m build --wheel --no-isolation
}

check() {
  local pytest_options=(
      -vv
      # hangs...
      --deselect tests/test_1374_to_rdataframe.py
      --deselect tests/test_1473_from_rdataframe.py
      --deselect tests/test_1508_awkward_from_rdataframe.py
      --deselect tests/test_1620_layout_builders.py
      --deselect tests/test_1625_multiple_columns_from_rdataframe.py
      --deselect tests/test_1781_rdataframe_snapshot.py
      --deselect tests/test_1829_to_from_rdataframe_bool.py
      --deselect tests/test_2202_filter_multiple_columns_from_rdataframe.py
      --deselect tests/test_2234_from_rdataframe_keep_order.py
      --deselect tests/test_2258_from_rdataframe_with_arguments.py
      --deselect tests/test_3375_add_rdf_column.py
  )

  cd $pkgbase
  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
  test-env/bin/python -m pytest "${pytest_options[@]}" tests
}

package_python-awkward() {
  optdepends+=("$pkgbase-docs: documentation")

  cd $pkgbase
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
  cd awkward-cpp
  python -m installer --destdir="$pkgdir" dist/*.whl
}

# package_python-awkward-docs() {
#   pkgdesc+=" - documentation"

#   cd $pkgbase

#   install -vDm 644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
#   install -vDm 644 README.md -t "$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
#   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
#   PYTHONPATH="$PWD/tmp-install/$site_packages" sphinx-build "$PWD"/docs "$pkgdir"/usr/share/doc/$pkgbase
# }