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

pkgname=python-copier
_name=${pkgname#python-}
pkgver=9.5.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=(
  '11dbb27d7d88608a57c99fbc392c2ca24841606738528e74ce4d7c3086476029'
)

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

check() {
  cd copier
  rm -rf test-env
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer "dist/$_name-$pkgver-"*.whl
  LC_ALL=C 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}"
}