summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6a70276c3ea35a464329951b531e04369bfbad07 (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
66
#  Maintainer: Blair Bonnett <blair.bonnett@gmail.com>
# Contributor: Andrej Radović <r.andrej@gmail.com>

pkgname=python-copier
_name=${pkgname#python-}
pkgver=9.2.0
pkgrel=1
pkgdesc='Library and command-line utility for rendering projects templates'
arch=('any')
url='https://github.com/copier-org/copier'
license=('MIT')

depends=(
  'python-colorama'
  'python-dunamai'
  'python-funcy'
  'python-jinja'
  'python-jinja2-ansible-filters'
  'python-packaging'
  'python-pathspec'
  'python-plumbum'
  'python-prompt_toolkit'
  'python-pydantic'
  'python-pygments'
  'python-questionary'
  'python-yaml'
)
makedepends=(
  'git' 'python-build' 'python-installer' 'python-wheel'
  'python-poetry-dynamic-versioning'
)
checkdepends=(
  'python-poethepoet' 'python-pytest' 'python-pytest-cov'
  'python-pytest-gitconfig' 'python-pytest-xdist'
)
optdepends=(
  'git: VCS support'
)

# PyPI tarball does not include tests; GitHub tarball fails to build
# as poetry-dynamic-versioning fails to find metadata.
source=(
  "git+https://github.com/copier-org/copier.git#tag=v$pkgver"
)
sha256sums=(
  'c802a669a970d50e1b516b0ab1f3e9474c70960a5530dd309af62fd0c39ea276'
)

build() {
  cd copier
  python -m build --wheel --no-isolation
}

check() {
  cd copier
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer "dist/$_name-$pkgver-"*.whl
  test-env/bin/python -m pytest -k 'not test_types and not test_commit_hooks_respected'
}

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