summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e3691636b5a3383684aec82f3a6d6369f5f67ff1 (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
# Maintainer: Carlos Aznarán <caznaranl@uni.pe>
# Contributor: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: Chih-Hsuan Yen <yan12125@archlinux.org>
_base=etils
pkgname=python-${_base}
pkgver=1.9.4
pkgrel=1
pkgdesc="Collection of common python utils"
url="https://github.com/google/${_base}"
license=(Apache-2.0)
arch=(any)
depends=(python)
makedepends=(python-build python-installer python-flit-core python-wheel)
# checkdepends=(python-pytest-subtests python-numpy python-typing_extensions
#   python-absl ipython python-jax python-importlib_resources python-tensorflow
#   python-tqdm python-pytorch python-fsspec) # python-simple_parsing python-chex python-dataclass_array
optdepends=('python-numpy: for etils.array_types, etils.ecolab, etils.enp'
  'ipython: for etils.ecolab'
  # 'python-mediapy: for etils.ecolab'
  'python-importlib_resources: for epath'
  'python-zipp: for etils.epath'
  'python-typing_extensions: for etils.epy'
  'python-absl: for etils.etqdm'
  'python-tqdm: for etils.etqdm'
  'python-dm-tree: for etils.etree.tree'
  'python-jax: for etils.etree.jax'
  'python-tensorflow: for etils.etree.nest'
)
source=(${_base}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz)
sha512sums=('1674a37314c4eb612e1c26d2baeed8c809e1fa73bd8ad52ad59acdfa273b4cbef73f8aea3f959846a4a16c1be18134238a609b103c818f933a29170ad3adf28c')

build() {
  cd ${_base}-${pkgver}
  python -m build --wheel --skip-dependency-check --no-isolation
}

# check() {
#   cd ${_base}-${pkgver}
#   python -m venv --system-site-packages test-env
#   test-env/bin/python -m installer dist/*.whl
#   test-env/bin/python -m pytest \
#     --ignore etils/eapp/dataclass_flags_test.py \
#     --ignore etils/ecolab/adhoc_lib/module_deps_utils_test.py \
#     --ignore etils/ecolab/array_as_img_test.py \
#     --ignore etils/ecolab/auto_display_utils_test.py \
#     --ignore etils/ecolab/colab_utils_test.py \
#     --ignore etils/ecolab/inplace_reload_test.py \
#     --ignore etils/ecolab/inspects/attrs_test.py \
#     --ignore etils/ecolab/inspects/html_helper_test.py \
#     --ignore etils/ecolab/inspects/nodes_test.py \
#     --ignore etils/ecolab/lazy_imports_test.py \
#     --ignore etils/edc/frozen_utils_test.py \
#     --ignore etils/epy/lazy_imports_utils_test.py \
#     --ignore etils/etree/tree_utils_test.py
# }

package() {
  cd ${_base}-${pkgver}
  PYTHONPYCACHEPREFIX="${PWD}/.cache/cpython/" python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}