1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-14 22:33:52 -05:00

upgrade pip detetcion in pip-rehash to accept multiple variations: (#3330)

- pip
- pipX
- pipX.Y
- * -m pip

Co-authored-by: Christian Fredrik Johnsen <christian@johnsen.no>
This commit is contained in:
rockandska
2025-09-17 02:53:37 +02:00
committed by GitHub
parent 7881c26b5a
commit 22a7c46d54
2 changed files with 70 additions and 0 deletions

View File

@@ -4,6 +4,9 @@ PYENV_REHASH_COMMAND="${PYENV_COMMAND##*/}"
# Remove any version information, from e.g. "pip2" or "pip3.10".
if [[ $PYENV_REHASH_COMMAND =~ ^(pip|easy_install)[23](\.[0-9]+)?$ ]]; then
PYENV_REHASH_COMMAND="${BASH_REMATCH[1]}"
# Check for ` -m pip ` in arguments
elif [[ "$*" =~ [[:space:]]-m[[:space:]]pip[[:space:]] ]]; then
PYENV_REHASH_COMMAND="pip"
fi
if [ -x "${PYENV_PIP_REHASH_ROOT}/${PYENV_REHASH_COMMAND}" ]; then