From 0b9d497cd51095335dd637d215278a0070a0e1e6 Mon Sep 17 00:00:00 2001 From: Dennis Camera Date: Thu, 28 Apr 2022 13:17:55 +0200 Subject: [PATCH 1/3] [type/__package_pip] Fall back to __object_id if the package name can't be deduced from --requirement --- type/__package_pip/explorer/state | 42 ++++++++++++++++++++++++++----- type/__package_pip/man.rst | 10 ++++++++ 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/type/__package_pip/explorer/state b/type/__package_pip/explorer/state index ee3527024..52bc5054e 100755 --- a/type/__package_pip/explorer/state +++ b/type/__package_pip/explorer/state @@ -43,11 +43,41 @@ test -n "${pyinterp}" || { } # Execute the matching Python interpreter of pip. -pip_python() { eval set -- "${pyinterp}" '"$@"'; "$@"; } +# shellcheck disable=SC2120 +pip_python() { eval "set -- \"${pyinterp}\" \"\$@"\"; "$@"; } -requirement=$("${__type_explorer:?}/requirement") +REQUIREMENT=$("${__type_explorer:?}/requirement") +export REQUIREMENT -pip_python -c '__import__("pkg_resources").require(__import__("sys").argv[1])' \ - "${requirement}" >/dev/null 2>&1 \ -&& echo present \ -|| echo absent +pip_python < Date: Mon, 2 May 2022 22:16:29 +0300 Subject: [PATCH 2/3] fix example --- type/__package_pip/man.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/type/__package_pip/man.rst b/type/__package_pip/man.rst index 145e98f6f..c6daecea6 100644 --- a/type/__package_pip/man.rst +++ b/type/__package_pip/man.rst @@ -92,7 +92,7 @@ EXAMPLES __package_pip mautrix-telegram --requirement mautrix-telegram[all] # Install package from URL - __package_pip mkosi --requirement git+https://github.com/systemd/mkosi.git + __package_pip mkosi --requirement mkosi@git+https://github.com/systemd/mkosi.git SEE ALSO From f56b107280b63d8731cc69320574f44a7c533dff Mon Sep 17 00:00:00 2001 From: Ander Punnar <4ND3R@users.noreply.github.com> Date: Mon, 2 May 2022 22:17:28 +0300 Subject: [PATCH 3/3] remove trailing whitespace --- type/__package_pip/man.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/type/__package_pip/man.rst b/type/__package_pip/man.rst index c6daecea6..284b4e6d2 100644 --- a/type/__package_pip/man.rst +++ b/type/__package_pip/man.rst @@ -92,7 +92,7 @@ EXAMPLES __package_pip mautrix-telegram --requirement mautrix-telegram[all] # Install package from URL - __package_pip mkosi --requirement mkosi@git+https://github.com/systemd/mkosi.git + __package_pip mkosi --requirement mkosi@git+https://github.com/systemd/mkosi.git SEE ALSO