diff --git a/templates/gitlab-ci-python.yml b/templates/gitlab-ci-python.yml
index 257bd3dc6ea881343e690e166eed62cc275908e5..b4caf2c6f3d7574365c759669cc032adde5f3d18 100644
--- a/templates/gitlab-ci-python.yml
+++ b/templates/gitlab-ci-python.yml
@@ -747,14 +747,17 @@ variables:
   }
 
   function _pip() {
+    cmd=$1
+    shift
+
     if [[ "$PYTHON_BUILD_SYSTEM" =~ ^uv ]]
     then
       maybe_install_uv
       # shellcheck disable=SC2086
-      uv pip ${PIP_OPTS} "$@"
+      uv pip "$cmd" ${PIP_OPTS} "$@"
     else
       # shellcheck disable=SC2086
-      _run pip ${PIP_OPTS} "$@"
+      _run pip "$cmd" ${PIP_OPTS} "$@"
     fi
   }