# Maintainer: Filipe LaĆns (FFY00) <lains@archlinux.org>
# Maintainer: Carl Smedstad <carsme@archlinux.org>
# Contributor: Johannes Dewender arch at JonnyJD dot net
# Contributor: Ivan Sichmann Freitas <ivansichfreitas@gmail.com>
# Contributor: Brice Maron <brice@bmaron.net>
# Contributor: Nuno Araujo <nuno.araujo at russo79.com>
# Contributor: Steven Allen <steven {at} stebalien {dot} com>
pkgname=python-keyring
pkgver=25.7.0
pkgrel=1
pkgdesc='Store and access your passwords safely'
arch=('any')
url='https://github.com/jaraco/keyring'
license=('MIT')
depends=(
'python'
'python-jaraco.classes'
'python-jaraco.context'
'python-jaraco.functools'
'python-secretstorage'
'python-importlib-metadata'
)
makedepends=(
'git'
'python-build'
'python-installer'
'python-setuptools-scm'
'python-shtab'
'python-wheel'
)
#checkdepends=(
# 'python-pyfakefs'
# 'python-pytest'
#)
optdepends=(
'libsecret: libsecret backend'
'python-dbus: kwallet backend'
'python-gobject: libsecret backend'
'python-keyrings-alt: Alternative backends'
'python-pluggy: devpi client'
)
source=("git+$url.git#tag=v$pkgver")
sha512sums=('2f4ec5dc743e519337836a20d2272a45a1137bde0d3110fad3478a0575c86979a05c7060dc6b1b2551d97bf322e2e61ce938b8c19e518f9865eefca466e1a075')
b2sums=('1e08e16b2cdae34eda5b76d958053ab7ee76afd2b2738e3964727775299892aed8b55f1c1d73d78d321b04e058cda425ade635a14108e04c9e98e8c9fdd05b44')
prepare() {
cd ${pkgname#python-}
# Revert removal of license file.. Sigh
git revert -n 9a81db3c77bc106017dcd4b0853a5a94f43ae33c
}
build() {
cd ${pkgname#python-}
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
python -m build --wheel --no-isolation --skip-dependency-check
# Completions
python -m venv --system-site-packages completion-env
completion-env/bin/python -m installer dist/*.whl
completion-env/bin/keyring --print-completion bash > keyring.bash
completion-env/bin/keyring --print-completion zsh > keyring.zsh
}
#check() {
# cd ${pkgname#python-}
# pytest --deselect tests/test_packaging.py::test_entry_point
#}
package() {
cd ${pkgname#python-}
python -m installer --destdir="$pkgdir" dist/*.whl
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
install -vDm644 keyring.bash "$pkgdir/usr/share/bash-completion/completions/keyring"
install -vDm644 keyring.zsh "$pkgdir/usr/share/zsh/site-functions/_keyring"
}