1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-16 23:33:45 -05:00

Fix pyenv-latest to ignore virtualenvs (#2608)

* Add test, exclude alphas as well
This commit is contained in:
native-api
2023-02-02 15:15:16 +03:00
committed by GitHub
parent 76e93b073e
commit 368e04f3fa
2 changed files with 21 additions and 1 deletions

View File

@@ -48,9 +48,10 @@ IFS=$'\n'
$(printf '%s\n' "${DEFINITION_CANDIDATES[@]}" | \
grep -Ee "^$prefix_re[-.]" || true))
#FIXME: <version>/envs/<virtualenv> should be excluded in Pyenv-Virtualenv via a hook
DEFINITION_CANDIDATES=(\
$(printf '%s\n' "${DEFINITION_CANDIDATES[@]}" | \
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/-latest$/d' -e '/(b|rc)[0-9]+$/d'));
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/-latest$/d' -e '/(a|b|rc)[0-9]+$/d' -e '/\/envs\//d'));
# Compose a sorting key, followed by | and original value
DEFINITION_CANDIDATES=(\