git » python-argcomplete.git » main » tree

[main] / PKGBUILD

# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Andrey Mikhaylenko <neithere at gmail dot com>

pkgname=python-argcomplete
_pyname=argcomplete
pkgver=3.1.2
pkgrel=1
pkgdesc='Easy, extensible command line tab completion of arguments for your Python script'
url='https://github.com/kislyuk/argcomplete'
arch=('any')
license=('Apache-2.0')
depends=('python')
makedepends=('git' 'python-build' 'python-installer' 'python-setuptools-scm' 'python-wheel')
#checkdepends=('fish' 'python-pexpect' 'python-pip' 'tcsh' 'zsh')
source=(${_pyname}::"git+$url?signed#tag=v$pkgver")
sha512sums=('4dfbc2b3542d791948602b05fb7939b22509f8a81d7870be92ef37af045132198ef28add76c3e4485f431ebb6cf52b489a443a48e6a0580e72be642b68770d15')
validpgpkeys=('29BCBADB4ECAAAC2382699388AFAFCD242818A52') # Andrey Kislyuk <kislyuk@gmail.com>

pkgver() {
  cd ${_pyname}
  git describe --tags --match 'v*' | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd ${_pyname}
  # Python 3.12.3 compatibility
  git cherry-pick -n 54a4846b3a774cd9037167898f3cce38ba9d58e8
  # ARMLFS hack
  sed -i -e 's/"setuptools>=67.7.2",//' pyproject.toml
}

build() {
  cd ${_pyname}
  python -m build --wheel --no-isolation
}

#check() {
#  cd ${_pyname}
  # workaround for https://github.com/kislyuk/argcomplete/issues/337
#  echo "set enable-bracketed-paste off" > .inputrc
#  INPUTRC=$PWD/.inputrc python test/test.py -v
#}

package() {
  cd ${_pyname}
  python -m installer --destdir="$pkgdir" dist/*.whl

  # Disabled again, see https://gitlab.archlinux.org/archlinux/packaging/packages/python-argcomplete/-/issues/3
  # local _site_packages=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
  # install -dm755 "$pkgdir"/usr/share/bash-completion/completions "$pkgdir"/usr/share/zsh/site-functions
  # ln -s ../../../..${_site_packages}/argcomplete/bash_completion.d/_python-argcomplete -t "$pkgdir"/usr/share/bash-completion/completions/
  # ln -s ../../../..${_site_packages}/argcomplete/bash_completion.d/_python-argcomplete -t "$pkgdir"/usr/share/zsh/site-functions/
}

# vim: ts=2 sw=2 et: