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

_pkgname=lazy_loader
pkgname=python-lazy-loader
pkgver=0.4
pkgrel=1
pkgdesc='Populate library namespace without incurring immediate import costs'
arch=('any')
url='https://github.com/scientific-python/lazy_loader'
license=('BSD-3-Clause')
depends=(
  python
)
makedepends=(
  python-flit-core
  python-build
  python-wheel
  python-installer
  python-setuptools
)
checkdepends=(
  python-pytest
)
source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/scientific-python/lazy_loader/archive/refs/tags/v${pkgver}.tar.gz")
sha512sums=('02ab8734dca77f53d742e2cf992f921ea2e440bd92a073a853b37aac69bb107484d25065565d85c68f4ba7e67f068321365bf82e0cb962ea58735515c1aa9c3b')

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}"

  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  rm -rfv ${pkgdir}${site_packages}/${_pkgname}/tests
}
# vim:set ts=2 sw=2 et: