summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ea32d86e014e1e7af9f94b3badb35b5b9ff60c1d (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
# Maintainer: Groctel <aur@taxorubio.com>
# shellcheck disable=SC1091,SC2034,SC2154,SC2164

_name=shutilwhich

pkgname=python-shutilwhich
pkgver=1.1.0
pkgrel=9
pkgdesc="A copy & paste backport of Python 3.3's shutil.which function."

arch=("any")
license=("PSF")
url="https://github.com/mbr/shutilwhich"

source=("${pkgname}-${pkgver}.tar.gz::$url/archive/${pkgver}.tar.gz")
sha256sums=('4292a973312c58ca1935ea75d7bd378b17668ef6aacfc812d00019e0726dea44')

depends=(
  "python"
)
makedepends=(
  "python-build"
  "python-installer"
  "python-setuptools"
  "python-wheel"
)
checkdepends=(
    "python-virtualenv"
)

build () {
  cd "$srcdir/$_name-$pkgver"
  python -m build --wheel --no-isolation
}

check () {
    cd "$srcdir/$_name-$pkgver"

    python -m venv venv
    (
        source venv/bin/activate
        pip install ./dist/*.whl pytest
        python -m pytest
    )
    rm -rf venv
}

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