Avoid the need to filter out envs in `pyenv-latest'

This commit is contained in:
Ivan Pozdeev 2023-02-02 18:14:42 +03:00
parent 446411dc64
commit 72c5b034ca

View file

@ -31,7 +31,7 @@ exitcode=0
IFS=$'\n'
if [[ -z $FROM_KNOWN ]]; then
DEFINITION_CANDIDATES=( $(pyenv-versions --bare) )
DEFINITION_CANDIDATES=( $(pyenv-versions --bare --skip-envs) )
else
DEFINITION_CANDIDATES=( $(python-build --definitions ) )
fi
@ -48,10 +48,9 @@ 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 '/(a|b|rc)[0-9]+$/d' -e '/\/envs\//d'));
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/-latest$/d' -e '/(a|b|rc)[0-9]+$/d'));
# Compose a sorting key, followed by | and original value
DEFINITION_CANDIDATES=(\