summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 67f14065352f3237fc2fd09c96b65af4c8768da3 (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
# Contributor: a821
# Contributor: Tim Meusel <tim@bastelfreak.de>
# Contributor: Florian Pritz <bluewind@xinu.at>
# Contributor: Christian Rebischke <chris.rebischke@archlinux.org>

pkgname=python-pypuppetdb
pkgver=3.2.0
pkgrel=2
pkgdesc='Library for working with the PuppetDB REST API'
arch=('any')
url='https://github.com/voxpupuli/pypuppetdb'
license=('Apache-2.0')
depends=('python-requests')
makedepends=('python-setuptools' 'python-sphinx_rtd_theme'
             'python-build' 'python-installer' 'python-wheel')
checkdepends=('python-pytest-cov' 'python-mock' 'python-httpretty')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/voxpupuli/pypuppetdb/archive/refs/tags/${pkgver}.tar.gz"
        "fix-deprecations-warnings.patch")
sha512sums=('a1f924c2fa63a915581c48a14512388e949d39ff3420b79a323b50949d2bf8fadcf6d92951480e0926d07dc18d82d1f46a35e80e812e5f0daa8f7cc0622c39de'
            '386e920dfc74a3ef0eeb691010fa8e0bfb0d9b218c2d4c9b0949f06ae26e6236bb1574fbcee1f471e1db5acb8537dc9a30d24085815230f5fbb262c41644183e')

prepare() {
  cd ${pkgname#python-}-${pkgver}
  patch -p1 < ../fix-deprecations-warnings.patch
}

build() {
  cd ${pkgname#python-}-${pkgver}
  python -m build --wheel --no-isolation
  cd docs
  PYTHONPATH=.. make man
}

check() {
  cd ${pkgname#python-}-${pkgver}
  pytest
}

package() {
  cd ${pkgname#python-}-${pkgver}
  python -m installer --destdir="$pkgdir" dist/*.whl
  rm -rf "${pkgdir}"/usr/requirements_for_tests

  install -D -m644 "docs/_build/man/pypuppetdb.1" "${pkgdir}/usr/share/man/man1/pypuppetdb.1"
}

# vim:set ts=2 sw=2 et: