summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: acf9712b1e804a75d03274e5cecc98fd3fd425b5 (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
# Maintainer: Carl Smedstad <carsme@archlinux.org>

pkgname=python-docopt-subcommands
_pkgname=${pkgname#python-}
pkgver=4.0.0
pkgrel=1
_commit=51e20890a6f7dfdce1f7556be2dd5fedb35a5fbf
pkgdesc="Create subcommand-based command-line programs with docopt"
arch=(any)
url="https://github.com/abingham/docopt-subcommands"
license=(MIT)
depends=(
  python
  python-docopt
)
makedepends=(
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(
  python-hypothesis
  python-pytest
)
source=("$pkgname-$pkgver.tar.gz::$url/archive/$_commit.tar.gz")
sha256sums=('277614a679607ef90e88a69f5b635013cf5d24a0ab45049e32e0e732ca9ed7b1')

_archive="$_pkgname-$_commit"

build() {
  cd "$_archive"

  python -m build --wheel --no-isolation
}

check() {
  cd "$_archive"

  rm -rf tmp_install
  python -m installer --destdir=tmp_install dist/*.whl
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  export PYTHONPATH="$PWD/tmp_install/$site_packages"
  pytest
}

package() {
  cd "$_archive"

  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE.txt
}