summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 01b90f0443791e413bb8242b98cbc1dcce72c02a (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
# Maintainer: Butui Hu <hot123tea123@gmail.com>

_pkgname=Augmentor
pkgname=python-augmentor
pkgver=0.2.12
pkgrel=2
pkgdesc='Image augmentation library in Python for machine learning'
arch=(any)
url=https://github.com/mdbloice/Augmentor
license=(MIT)
depends=(
  python-numpy
  python-pandas
  python-pillow
  python-tqdm
)
makedepends=(
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(python-pytest)
source=("${_pkgname}-${pkgver}.tar.gz"::"https://github.com/mdbloice/Augmentor/archive/${pkgver}.tar.gz")
sha512sums=('27a37d52cbf51dcb2bb8c7c5d74efbe2d2cb066b9ed958b3a84456d524fff82dd19e9da1ab23064490171d078ebd764e900fc39d8fb4e4bd1e23b13e0589cb85')

prepare() {
  # fix https://github.com/mdbloice/Augmentor/issues/218
  sed -i "s,cat_col_series.get_values,cat_col_series.to_numpy," "${_pkgname}-${pkgver}/Augmentor/ImageUtilities.py"
}

build() {
  cd "${_pkgname}-${pkgver}"
  python -m build --wheel --no-isolation
}

check() {
  cd "${_pkgname}-${pkgver}"
  pytest -v
}

package() {
  cd "${_pkgname}-${pkgver}"
  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm644 LICENSE.md -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
# vim:set ts=2 sw=2 et: