Date: Saturday, May 13, 2023 @ 09:11:57
  Author: grawlinson
Revision: 1460175

upgpkg: python-shtab 1.6.1-1; new upstream release & FS#75708

Modified:
  python-shtab/trunk/PKGBUILD

----------+
 PKGBUILD |   22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-05-13 09:01:32 UTC (rev 1460174)
+++ PKGBUILD    2023-05-13 09:11:57 UTC (rev 1460175)
@@ -2,8 +2,8 @@
 # Contributor: SZanko, szanko at protonmail dot com
 
 pkgname=python-shtab
-pkgver=1.6.0
-pkgrel=2
+pkgver=1.6.1
+pkgrel=1
 pkgdesc='Automagic shell tab completion for Python CLI applications'
 arch=('any')
 url='https://github.com/iterative/shtab'
@@ -21,7 +21,7 @@
   'python-pytest-cov'
   'python-pytest-timeout'
 )
-_commit='68ac16999be08cf5033c601f162020bde4aaf0ad'
+_commit='80a105058bafd32c0669eb2e2b477502f195c48e'
 source=("$pkgname::git+$url#commit=$_commit")
 b2sums=('SKIP')
 
@@ -35,6 +35,18 @@
   cd "$pkgname"
 
   python -m build --wheel --no-isolation
+
+  local site_packages=$(python -c "import site; 
print(site.getsitepackages()[0])")
+
+  # install to temporary directory
+  python -m installer --destdir="$PWD/tmp_install" dist/*.whl
+
+  export PYTHONPATH="$PWD/tmp_install$site_packages"
+
+  # generate shell completions
+  for shell in bash zsh; do
+    python -m shtab --print-own-completion "$shell" > "$shell.completion"
+  done
 }
 
 check() {
@@ -48,6 +60,10 @@
 
   python -m installer --destdir="$pkgdir" dist/*.whl
 
+  # completions
+  install -vDm644 bash.completion 
"$pkgdir/usr/share/bash-completion/completions/shtab"
+  install -vDm644 zsh.completion "$pkgdir/usr/share/zsh/site-functions/_shtab"
+
   # license
   install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENCE
 }

Reply via email to