From eb06ce8a99b72c568d8aa637afef340c93e6a6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= Date: Thu, 22 Sep 2022 18:53:43 +0200 Subject: [PATCH] hatch: generate and bundle completions --- srcpkgs/hatch/template | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/srcpkgs/hatch/template b/srcpkgs/hatch/template index a626aab39ec5..17344e5263c4 100644 --- a/srcpkgs/hatch/template +++ b/srcpkgs/hatch/template @@ -1,7 +1,7 @@ # Template file for 'hatch' pkgname=hatch version=1.5.0 -revision=1 +revision=2 build_style=python3-pep517 # ignore backend tests, because updating hatchling when there is no new hatch # version yet breaks these in hatch. @@ -9,12 +9,13 @@ make_check_args="--deselect tests/cli/test_root.py::TestFreshInstallation::test_ --deselect tests/cli/run/test_run.py::test_scripts_no_environment --ignore tests/backend --ignore backend/tests" -hostmakedepends="hatchling" -depends="python3-atomicwrites python3-click hatchling python3-httpx - python3-keyring python3-pexpect python3-platformdirs python3-pyperclip - python3-rich python3-tomli-w python3-tomlkit python3-userpath - python3-virtualenv python3-hyperlink" -checkdepends="${depends} python3-pytest python3-pytest-mock +_deps="python3-click hatchling python3-httpx python3-hyperlink python3-keyring + python3-pexpect python3-platformdirs python3-pyperclip python3-rich + python3-shellingham python3-tomli-w python3-tomlkit python3-userpath + python3-virtualenv" +hostmakedepends="hatchling ${_deps}" +depends="${_deps}" +checkdepends="${_deps} python3-pytest python3-pytest-mock python3-pytest-xdist git python3-pip" short_desc="Modern, extensible Python project management " maintainer="Jan Christian Grünhage " @@ -27,4 +28,10 @@ make_check_pre="env PYTHONPATH=./src" post_install() { vlicense LICENSE.txt + + for shell in zsh bash fish; do + PYTHONPATH="${DESTDIR}/${py3_sitelib}" PATH="${DESTDIR}/usr/bin:${PATH}" \ + _HATCH_COMPLETE="${shell}_source" hatch > "hatch.${shell}" + vcompletion "hatch.${shell}" "${shell}" + done }