summaryrefslogtreecommitdiff
path: root/dev-python/typer
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/typer')
-rw-r--r--dev-python/typer/Manifest2
-rw-r--r--dev-python/typer/metadata.xml14
-rw-r--r--dev-python/typer/typer-0.15.3.ebuild92
-rw-r--r--dev-python/typer/typer-0.16.0.ebuild67
4 files changed, 79 insertions, 96 deletions
diff --git a/dev-python/typer/Manifest b/dev-python/typer/Manifest
index 230682e9b5ae..414effc0be07 100644
--- a/dev-python/typer/Manifest
+++ b/dev-python/typer/Manifest
@@ -1 +1 @@
-DIST typer-0.15.3.tar.gz 101641 BLAKE2B c400974553ecaa1aa8ebeacc0042b50b5c7805dadbeca33225d9bedff415b10ce644b384fc699660a34f1d3a5049ceff67e682a5e7fb5910d7b264b49ce0e4ef SHA512 0562b8305bb8d494112919962aa74ca750ecdef2f70c0fd1f956101d2b81c28e9f31b94c8258eaa7f3cf7c3f685e48c86d8469a63c9d0e65eb1b49d79e6220c6
+DIST typer-0.16.0.tar.gz 102625 BLAKE2B 9d9974af18697bdfac6954d596537178d5bc5ee8fd2e812561f5d282d02816d945a37c2dc60b90711ff9abe8c5df5d08b08cc321854d2bf75fd3567e5d4ce3d5 SHA512 72ed9d0996ee4a96dffd866332916c705a2f5c11547248039c828b5180193e8ef9aed0789605703c9f7350f3f9d91049cec4b185dcbc1e8fb662b6dc7385f01e
diff --git a/dev-python/typer/metadata.xml b/dev-python/typer/metadata.xml
index 8a81ebe4b659..af170d60a2dc 100644
--- a/dev-python/typer/metadata.xml
+++ b/dev-python/typer/metadata.xml
@@ -9,10 +9,18 @@
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
<use>
- <flag name="rich">Rich text output via <pkg>dev-python/rich</pkg></flag>
- <flag name="shell-detection">detect current shell with <pkg>dev-python/shellingham</pkg> for completions</flag>
+ <flag name="cli">
+ Install "typer" entry point (conflicts with dev-lang/erlang).
+ Even with the flag disabled, the CLI can still be used
+ via "python -m typer".
+ </flag>
</use>
- <origin>gentoo-guru-overlay</origin>
+ <origin>gentoo-staging</origin>
+ <stabilize-allarches/>
</pkgmetadata> \ No newline at end of file
diff --git a/dev-python/typer/typer-0.15.3.ebuild b/dev-python/typer/typer-0.15.3.ebuild
deleted file mode 100644
index c6921119791c..000000000000
--- a/dev-python/typer/typer-0.15.3.ebuild
+++ /dev/null
@@ -1,92 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{9,10,11,12,13} )
-DISTUTILS_USE_PEP517=pdm-backend
-
-inherit distutils-r1 shell-completion pypi
-
-DESCRIPTION="Build great CLIs. Easy to code. Based on Python type hints."
-HOMEPAGE="
- https://typer.tiangolo.com/
- https://github.com/tiangolo/typer
- https://pypi.org/project/typer/
-"
-SRC_URI="$(pypi_sdist_url "${PN}" "${PV}")"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~amd64 ~arm64"
-
-IUSE="+rich shell-detection test"
-
-BDEPEND="
- test? (
- $(python_gen_cond_dep '
- dev-python/coverage[${PYTHON_USEDEP}]
- dev-python/shellingham[${PYTHON_USEDEP}]
- ')
- )
-"
-RDEPEND="
- $(python_gen_cond_dep '
- dev-python/click[${PYTHON_USEDEP}]
- dev-python/typing-extensions[${PYTHON_USEDEP}]
- rich? ( dev-python/rich[${PYTHON_USEDEP}] )
- shell-detection? ( dev-python/shellingham[${PYTHON_USEDEP}] )
- ')
-"
-
-distutils_enable_tests pytest
-
-src_test() {
- export TERMINAL_WIDTH=3000
- export _TYPER_FORCE_DISABLE_TERMINAL=1
-
- distutils-r1_src_test "${@}"
-}
-
-src_compile() {
- distutils-r1_src_compile "${@}"
-
- local shell
- for shell in bash zsh fish; do
- typer_gencomp ${shell}
- done
-}
-
-typer_get_comp() {
- local COMPLETIONSDIR="${WORKDIR}/comp"
- local shell="$1"
-
- case "${shell}" in
- bash) echo "${COMPLETIONSDIR}/${PN}" ;;
- zsh) echo "${COMPLETIONSDIR}/_${PN}" ;;
- fish) echo "${COMPLETIONSDIR}/${PN}.fish" ;;
- *) die "unknown shell: ${shell}" ;;
- esac
-}
-
-typer_gencomp() {
- local COMPLETIONSDIR="${WORKDIR}/comp"
- mkdir "${COMPLETIONSDIR}" 2> /dev/null
- local shell="$1"
-
- compfile="$(typer_get_comp "${@}")"
-
- _TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION=1 python -m typer --show-completion "${shell}" |
- sed 's/python -m //g ; s/_PYTHON _M //g ; s/python_m//g ; s/TYPER_COMPLETE/_TYPER_COMPLETE/' > "${compfile}" ||
- die "failed to generate ${shell} completion"
-
- einfo "generated completion script for ${shell}: ${compfile}"
-}
-
-src_install() {
- distutils-r1_src_install "${@}"
-
- dobashcomp "$(typer_get_comp bash)"
- dozshcomp "$(typer_get_comp zsh)"
- dofishcomp "$(typer_get_comp fish)"
-}
diff --git a/dev-python/typer/typer-0.16.0.ebuild b/dev-python/typer/typer-0.16.0.ebuild
new file mode 100644
index 000000000000..478a50bcc17c
--- /dev/null
+++ b/dev-python/typer/typer-0.16.0.ebuild
@@ -0,0 +1,67 @@
+# Copyright 2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=pdm-backend
+PYTHON_COMPAT=( python3_{11..14} )
+
+inherit distutils-r1 shell-completion pypi
+
+DESCRIPTION="Build great CLIs. Easy to code. Based on Python type hints"
+HOMEPAGE="
+ https://typer.tiangolo.com/
+ https://github.com/fastapi/typer/
+ https://pypi.org/project/typer/
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+IUSE="cli"
+
+RDEPEND="
+ >=dev-python/click-8.0.0[${PYTHON_USEDEP}]
+ >=dev-python/rich-10.11.0[${PYTHON_USEDEP}]
+ >=dev-python/shellingham-1.3.0[${PYTHON_USEDEP}]
+ >=dev-python/typing-extensions-3.7.4.3[${PYTHON_USEDEP}]
+ cli? ( !dev-lang/erlang )
+"
+BDEPEND="
+ test? (
+ dev-python/coverage[${PYTHON_USEDEP}]
+ )
+"
+
+EPYTEST_XDIST=1
+distutils_enable_tests pytest
+
+src_prepare() {
+ distutils-r1_src_prepare
+
+ if ! use cli; then
+ sed -i -e '/typer\.cli/d' pyproject.toml || die
+ fi
+}
+
+python_test() {
+ # See scripts/tests.sh
+ local -x TERMINAL_WIDTH=3000
+ local -x _TYPER_FORCE_DISABLE_TERMINAL=1
+ local -x _TYPER_RUN_INSTALL_COMPLETION_TESTS=1
+
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ epytest
+}
+
+python_install() {
+ if use cli && [[ ! ${COMPLETIONS_INSTALLED} ]]; then
+ local -x _TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION=1
+ newbashcomp - typer < <(typer --show-completion bash || die)
+ newzshcomp - typer < <(typer --show-completion zsh || die)
+ newfishcomp - typer < <(typer --show-completion fish || die)
+ COMPLETIONS_INSTALLED=1
+ fi
+
+ distutils-r1_python_install
+}