summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d33c92f54d0f7e1dc28f5de093f0192ac5cf1362 (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
61
62
63
64
65
# Maintainer: Claudia Pellegrino <auerhuhn@archlinux.org>

pkgname=python-pytest-http-snapshot
_gitpkgname=http-snapshot
pkgver=0.1.9
pkgrel=1
pkgdesc='Pytest plugin that captures and snapshots HTTP roundtrips. Supports httpx and requests.'
arch=('any')
url='https://github.com/karpetrosyan/http-snapshot'
license=('MIT')
depends=(
  'python'
  'python-inline-snapshot'
  'python-pytest'
)
makedepends=(
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
checkdepends=(
  'python-httpx'
  'python-requests'
  'python-urllib3'
)
optdepends=(
  'python-httpx: integration with httpx'
  'python-requests: integration with requests'
  'python-urllib3: integration with requests'
)

source=(
  "${_gitpkgname}-${pkgver}.tar.gz::https://github.com/karpetrosyan/http-snapshot/archive/${pkgver}.tar.gz"
)

sha512sums=(
  '836530661757b20bb2df5da62d89956dd5781f8ca358e1f9974c884fbd751f79e0a5f3c851bbbcb28366995e5300f89b2df21eb19ec7d5a8f0425d588c005cfe'
)

build() {
  cd "${_gitpkgname}-${pkgver}"
  echo >&2 'Building wheel'
  python -m build --wheel --no-isolation
}

check() {
  cd "${_gitpkgname}-${pkgver}"
  pytest
}

package() {
  cd "${_gitpkgname}-${pkgver}"

  echo >&2 'Packaging the wheel'
  python -I -m installer --destdir="${pkgdir}" dist/*.whl

  echo >&2 'Packaging the documentation'
  install -D -m 644 -t "${pkgdir}/usr/share/doc/${pkgname}" \
    README.md

  echo >&2 'Packaging the license'
  install -D -m 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" \
    LICENSE
}