summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 953c76e29abfb12ceac7b8ebd965a076f997abc0 (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
#  Maintainer: Blair Bonnett <blair.bonnett@gmail.com>
# Contributor: Andrej Radović <r.andrej@gmail.com>

pkgname=python-iteration-utilities
pkgver=0.12.1
pkgrel=1
pkgdesc="Utilities based on Pythons iterators and generators."
url='https://iteration-utilities.readthedocs.io'
license=('Apache-2.0')
arch=('x86_64')

depends=('python')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-pytest')

_pypi=iteration_utilities
source=(
  "https://files.pythonhosted.org/packages/source/${_pypi::1}/$_pypi/$_pypi-$pkgver.tar.gz"
)
sha256sums=(
  'a17bd698bc65b796b265e56f02a8d71f517716dc066a4c507e12563795bfe3bd'
)

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

check() {
  cd "$_pypi-$pkgver"
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer "dist/$_pypi-$pkgver-"*.whl
  test-env/bin/python -m pytest
}

package() {
  cd "$_pypi-$pkgver"
  python -m installer --destdir="$pkgdir" "dist/$_pypi-$pkgver-"*.whl

  # Remove source code from the final package.
  find "$pkgdir" -type f -name "*.[ch]" -delete
  find "$pkgdir" -type d -name "_iteration_utilities" -delete
}