upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / python-dunamai / trunk / PKGBUILD
blob67500c0d3d574a0ce5977f4f09dea87d885bc814
1 # Maintainer: George Rawlinson <grawlinson@archlinux.org>
3 pkgname=python-dunamai
4 pkgver=1.16.0
5 pkgrel=1
6 pkgdesc='A library for producing dynamic version strings, derived from VCS tags'
7 arch=('any')
8 url='https://github.com/mtkennerly/dunamai'
9 license=('MIT')
10 depends=(
11   'python'
12   'python-packaging'
14 makedepends=(
15   'git'
16   'python-build'
17   'python-installer'
18   'python-poetry-core'
20 checkdepends=('python-pytest' 'python-setuptools')
21 _commit='fe69436133d0ea2097a9fed1dbb31ec96263cf83'
22 source=("$pkgname::git+$url#commit=$_commit")
23 b2sums=('SKIP')
25 pkgver() {
26   cd "$pkgname"
28   git describe --tags | sed 's/^v//'
31 build() {
32   cd "$pkgname"
34   python -m build --wheel --no-isolation
37 check() {
38   cd "$pkgname"
40   # temporary install so that:
41   # * pkg_resources can pick up the package
42   # * the required binary can be added to $PATH
43   python -m installer --destdir="$(pwd)/tmp" dist/*.whl
44   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
45   export PATH="$(pwd)/tmp/usr/bin:$PATH"
46   export PYTHONPATH="$(pwd)/tmp/$site_packages"
48   # run tests, skipping annoying ones that require messing with global git config
49   pytest -v \
50     --deselect tests/integration/test_dunamai.py::test__version__from_git__with_annotated_tags \
51     --deselect tests/integration/test_dunamai.py::test__version__from_git__with_lightweight_tags \
52     --deselect tests/integration/test_dunamai.py::test__version__from_git__with_mixed_tags \
53     --deselect tests/integration/test_dunamai.py::test__version__from_git__with_nonchronological_commits \
54     --deselect tests/integration/test_dunamai.py::test__version__from_git__gitflow
57 package() {
58   cd "$pkgname"
60   python -m installer --destdir="$pkgdir" dist/*.whl
62   # license
63   install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE