2021-07-24 10:00:43 +00:00
|
|
|
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
|
2021-09-27 23:54:24 +00:00
|
|
|
# Contributor: Jayson Reis <santosdosreis@gmail.com>
|
2021-07-24 10:00:43 +00:00
|
|
|
|
2022-01-17 21:19:34 +00:00
|
|
|
pkgname=python-commitizen
|
2022-07-03 19:29:27 +00:00
|
|
|
_pkgname="${pkgname#python-}"
|
2022-09-25 09:07:59 +00:00
|
|
|
pkgver=2.35.0
|
2022-09-16 00:24:28 +00:00
|
|
|
pkgrel=1
|
2022-04-18 01:57:50 +00:00
|
|
|
pkgdesc='A tool for enforcing descriptive commit messages and version/changelog management'
|
2021-07-24 10:00:43 +00:00
|
|
|
arch=('any')
|
2022-04-18 01:57:50 +00:00
|
|
|
url='https://github.com/commitizen-tools/commitizen'
|
2021-07-24 10:00:43 +00:00
|
|
|
license=('MIT')
|
|
|
|
depends=(
|
|
|
|
'python'
|
2021-08-14 02:09:50 +00:00
|
|
|
'python-questionary'
|
|
|
|
'python-decli'
|
2021-07-24 10:00:43 +00:00
|
|
|
'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'
|
2021-07-24 10:00:43 +00:00
|
|
|
)
|
2021-09-27 23:54:24 +00:00
|
|
|
makedepends=(
|
2022-02-07 22:52:32 +00:00
|
|
|
'git'
|
2021-09-27 23:54:24 +00:00
|
|
|
'python-build'
|
2022-01-17 21:19:34 +00:00
|
|
|
'python-poetry-core'
|
2022-04-18 01:57:50 +00:00
|
|
|
'python-installer'
|
2021-09-27 23:54:24 +00:00
|
|
|
)
|
2022-09-16 00:24:28 +00:00
|
|
|
checkdepends=(
|
|
|
|
'python-pytest'
|
|
|
|
'python-pytest-freezegun'
|
|
|
|
'python-pytest-mock'
|
|
|
|
'python-pytest-regressions'
|
|
|
|
'python-typing_extensions'
|
|
|
|
)
|
2022-01-17 21:19:34 +00:00
|
|
|
provides=('cz' 'git-cz')
|
|
|
|
conflicts=('nodejs-commitizen' 'commitizen-go')
|
2022-09-25 09:07:59 +00:00
|
|
|
_commit='a9873d1cc5a229f97f7f775511cecffa8288e071'
|
2022-02-07 22:52:32 +00:00
|
|
|
source=("$pkgname::git+$url.git#commit=$_commit")
|
|
|
|
b2sums=('SKIP')
|
2021-07-24 10:00:43 +00:00
|
|
|
|
2022-02-07 22:52:32 +00:00
|
|
|
pkgver() {
|
|
|
|
cd "$pkgname"
|
|
|
|
|
|
|
|
git describe --tags | sed 's/^v//'
|
|
|
|
}
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd "$pkgname"
|
2021-07-24 10:00:43 +00:00
|
|
|
|
2021-09-27 23:54:24 +00:00
|
|
|
# create completions
|
|
|
|
mkdir completions
|
|
|
|
register-python-argcomplete --shell bash cz > completions/bash
|
|
|
|
register-python-argcomplete --shell fish cz > completions/fish
|
|
|
|
}
|
2021-07-24 10:00:43 +00:00
|
|
|
|
|
|
|
build() {
|
2022-02-07 22:52:32 +00:00
|
|
|
cd "$pkgname"
|
2021-09-27 23:54:24 +00:00
|
|
|
|
2022-01-17 21:19:34 +00:00
|
|
|
python -m build \
|
|
|
|
--wheel \
|
|
|
|
--skip-dependency-check \
|
|
|
|
--no-isolation
|
2021-07-24 10:00:43 +00:00
|
|
|
}
|
|
|
|
|
2022-09-16 00:24:28 +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]
|
|
|
|
}
|
|
|
|
|
2021-07-24 10:00:43 +00:00
|
|
|
package() {
|
2022-02-07 22:52:32 +00:00
|
|
|
cd "$pkgname"
|
2021-07-24 10:00:43 +00:00
|
|
|
|
2022-04-18 01:57:50 +00:00
|
|
|
python -m installer \
|
2021-12-14 02:10:32 +00:00
|
|
|
--destdir="$pkgdir" \
|
2021-07-24 10:00:43 +00:00
|
|
|
dist/*.whl
|
2021-08-14 02:09:50 +00:00
|
|
|
|
2022-01-17 21:26:48 +00:00
|
|
|
# fix permissions issue
|
|
|
|
find "$pkgdir/usr/bin" -type f -exec chmod 0755 {} +
|
|
|
|
|
2021-07-24 10:00:43 +00:00
|
|
|
# license
|
|
|
|
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
|
2021-09-27 23:54:24 +00:00
|
|
|
|
|
|
|
# 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"
|
2021-07-24 10:00:43 +00:00
|
|
|
}
|