From a428180cb8ed13f31d493f6457fb9faea6799422 Mon Sep 17 00:00:00 2001 From: "Billakanti, Koushik" Date: Mon, 27 Oct 2025 13:05:17 -0500 Subject: [PATCH] [SWDEV-434556] Updated warning text when argcomplete fails to install (#778) * Solved error: [Errno 2] No such file or directory: '/usr/local/lib/python3.10/dist-packages/argcomplete/bash_completion.d/python-argcomplete.sh' [ROCm/amdsmi commit: 013d6cb511f7b2e3fb4c02180cc2f80793ccdcbd] --- projects/amdsmi/DEBIAN/postinst.in | 13 +++++++++---- projects/amdsmi/RPM/post.in | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/projects/amdsmi/DEBIAN/postinst.in b/projects/amdsmi/DEBIAN/postinst.in index d70e03bca6..e6f55631d6 100755 --- a/projects/amdsmi/DEBIAN/postinst.in +++ b/projects/amdsmi/DEBIAN/postinst.in @@ -176,15 +176,20 @@ do_install_amdsmi_python_lib() { export PIP_BREAK_SYSTEM_PACKAGES="$PREVIOUS_PIP_BREAK_SYSTEM_PACKAGES" # only try to activate argcomplete if such command exists + # python3-argcomplete is recommended but optional, we handle its absence gracefully if command -v activate-global-python-argcomplete &>/dev/null; then - activate-global-python-argcomplete + activate-global-python-argcomplete 2>/dev/null || { + echo "[INFO] Bash completion activation skipped. You can manually enable it with: activate-global-python-argcomplete" + } else # try older argcomplete3 version if command -v activate-global-python-argcomplete3 &>/dev/null; then - activate-global-python-argcomplete3 + activate-global-python-argcomplete3 2>/dev/null || { + echo "[INFO] Bash completion activation skipped. You can manually enable it with: activate-global-python-argcomplete3" + } else - echo "[WARNING] Could not find argcomplete or argcomplete3. "\ - "Argument completion will not work..." + echo "[WARNING] Could not find argcomplete activation command. "\ + "Argument completion will not work. Install python3-argcomplete package to enable it." fi fi } diff --git a/projects/amdsmi/RPM/post.in b/projects/amdsmi/RPM/post.in index 96434e09dc..86cac35a16 100755 --- a/projects/amdsmi/RPM/post.in +++ b/projects/amdsmi/RPM/post.in @@ -178,15 +178,20 @@ do_install_amdsmi_python_lib() { export PIP_BREAK_SYSTEM_PACKAGES="$PREVIOUS_PIP_BREAK_SYSTEM_PACKAGES" # only try to activate argcomplete if such command exists + # python3-argcomplete is recommended but optional, we handle its absence gracefully if command -v activate-global-python-argcomplete &>/dev/null; then - activate-global-python-argcomplete + activate-global-python-argcomplete 2>/dev/null || { + echo "[INFO] Bash completion activation skipped. You can manually enable it with: activate-global-python-argcomplete" + } else # try older argcomplete3 version if command -v activate-global-python-argcomplete3 &>/dev/null; then - activate-global-python-argcomplete3 + activate-global-python-argcomplete3 2>/dev/null || { + echo "[INFO] Bash completion activation skipped. You can manually enable it with: activate-global-python-argcomplete3" + } else - echo "[WARNING] Could not find argcomplete or argcomplete3. "\ - "Argument completion will not work..." + echo "[WARNING] Could not find argcomplete activation command. "\ + "Argument completion will not work. Install python3-argcomplete package to enable it." fi fi }