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

_name=backports.cached_property

pkgname=python-backports.cached_property
pkgver=1.0.2
pkgrel=2
pkgdesc="Python 3.8 functools.cached_property backport to python 3.6."

arch=("any")
license=("MIT")
url="https://github.com/penguinolog/backports.cached_property"

source=("$url/archive/refs/tags/$pkgver.tar.gz")
sha512sums=('393272e93f97783d575268e19005d3295570dfc562afe179b6d4ac56960b57b71454639f3588a1dcd531e0871fc7b6fa91bbd854ad4f1c16875f1d6d75cb0aa2')

depends=(
    "python"
    "python-backports"
)
makedepends=(
    "python-build"
    "python-installer"
    "python-setuptools"
    "python-setuptools-scm"
    "python-wheel"
)
checkdepends=(
    "python-pytest"
    "python-pytest-mock"
    "python-virtualenv"
)

prepare() {
    cd "$srcdir/$_name-$pkgver"
    rm backports/__init__.py # Provided by python-backports
}

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

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

    python -m venv --system-site-packages venv
    source venv/bin/activate
    pip install ./dist/*.whl
    PYTHONPATH="$PYTHONPATH:." pytest
    rm -rf venv
}

package() {
    cd "$srcdir/$_name-$pkgver"
    python -m installer --destdir="$pkgdir" dist/*.whl
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}