From 91aa52ab55f7df5bf5b181203be805758bf4f6a0 Mon Sep 17 00:00:00 2001 From: odrling Date: Fri, 5 Apr 2024 21:39:46 +0200 Subject: [PATCH] dev-python/typer: install shell completions for typer command --- dev-python/typer/typer-0.12.1.ebuild | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dev-python/typer/typer-0.12.1.ebuild b/dev-python/typer/typer-0.12.1.ebuild index bc9d278..fcb774a 100644 --- a/dev-python/typer/typer-0.12.1.ebuild +++ b/dev-python/typer/typer-0.12.1.ebuild @@ -6,7 +6,7 @@ EAPI=8 PYTHON_COMPAT=( python3_{10..12} ) DISTUTILS_USE_PEP517=pdm-backend -inherit distutils-r1 +inherit distutils-r1 shell-completion DESCRIPTION="Build great CLIs. Easy to code. Based on Python type hints." HOMEPAGE=" @@ -14,9 +14,7 @@ HOMEPAGE=" https://github.com/tiangolo/typer https://pypi.org/project/typer/ " -SRC_URI=" - https://github.com/tiangolo/${PN}/archive/${PV}.tar.gz - -> ${P}.gh.tar.gz" +SRC_URI="https://github.com/tiangolo/${PN}/archive/${PV}/${P}.gh.tar.gz" LICENSE="MIT" SLOT="0" @@ -46,3 +44,12 @@ src_test() { distutils-r1_src_test "${@}" } + +src_install() { + distutils-r1_src_install "${@}" + + export _TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION=1 + newzshcomp <(python -m typer --show-completion zsh) "_${PN}" + newfishcomp <(python -m typer --show-completion fish) "${PN}.fish" + newbashcomp <(python -m typer --show-completion bash) "${PN}" +}