arch-pkgs/python-commitizen/PKGBUILD

94 lines
2.3 KiB
Text
Raw Permalink Normal View History

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Jayson Reis <santosdosreis@gmail.com>
pkgname=python-commitizen
2022-07-03 19:29:27 +00:00
_pkgname="${pkgname#python-}"
2023-01-24 07:57:20 +00:00
pkgver=2.40.0
pkgrel=1
pkgdesc='A tool for enforcing descriptive commit messages and version/changelog management'
arch=('any')
url='https://github.com/commitizen-tools/commitizen'
license=('MIT')
depends=(
'python'
'python-questionary'
'python-decli'
'python-colorama'
'python-termcolor'
'python-packaging'
'python-tomlkit'
'python-jinja'
'python-pyaml'
'python-argcomplete'
'python-prompt_toolkit'
2022-09-16 00:04:40 +00:00
'python-charset-normalizer'
)
makedepends=(
'git'
'python-build'
'python-poetry-core'
'python-installer'
)
checkdepends=(
'python-pytest'
'python-pytest-freezegun'
'python-pytest-mock'
'python-pytest-regressions'
'python-typing_extensions'
)
provides=('cz' 'git-cz')
conflicts=('nodejs-commitizen' 'commitizen-go')
2023-01-24 07:57:20 +00:00
_commit='52057ace9f7e1400d560eac76065e257ee3b2213'
source=("$pkgname::git+$url.git#commit=$_commit")
b2sums=('SKIP')
pkgver() {
cd "$pkgname"
git describe --tags | sed 's/^v//'
}
prepare() {
cd "$pkgname"
# create completions
mkdir completions
register-python-argcomplete --shell bash cz > completions/bash
register-python-argcomplete --shell fish cz > completions/fish
}
build() {
cd "$pkgname"
2023-01-02 08:12:47 +00:00
python -m build --wheel --no-isolation
}
2023-01-02 08:12:47 +00:00
#check() {
# cd "$pkgname"
#
# # setup git
# git config --global user.email "builder@domain.tld"
# git config --global user.name "Builder"
#
# pytest -vvv tests \
# --deselect tests/test_bump_create_commit_message.py::test_bump_pre_commit_changelog[True] \
# --deselect tests/test_bump_create_commit_message.py::test_bump_pre_commit_changelog_fails_always[True] \
# --deselect tests/test_bump_create_commit_message.py::test_bump_pre_commit_changelog_fails_always[False]
#}
package() {
cd "$pkgname"
2023-01-02 08:12:47 +00:00
python -m installer --destdir="$pkgdir" dist/*.whl
# fix permissions issue
find "$pkgdir/usr/bin" -type f -exec chmod 0755 {} +
# license
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
# shell completions
install -vDm644 completions/bash "$pkgdir/usr/share/bash-completion/completions/cz"
install -vDm644 completions/fish "$pkgdir/usr/share/fish/vendor_completions.d/cz.fish"
}