python-build: Support automatically picking PyPy as bootstrap version

This commit is contained in:
Ivan Pozdeev 2026-09-21 23:32:12 +03:00
parent 9ac7b27486
commit 08021a03ab

View File

@ -261,7 +261,7 @@ for i in "${!DEFINITIONS[@]}"; do
PYENV_BOOTSTRAP_VERSION="${PYENV_RPYTHON_VERSION}"
else
for version in $(pyenv-versions --bare | sort -r); do
if [[ "${version}" == "2.7"* ]]; then
if [[ "${version}" =~ ^(2\.7|pypy2\.7) ]]; then
PYENV_BOOTSTRAP_VERSION="$version"
break
fi
@ -275,7 +275,7 @@ for i in "${!DEFINITIONS[@]}"; do
fi
done
else
echo "pyenv-install: $VERSION_NAME: PyPy requires Python 2.7 to build from source." >&2
echo "pyenv-install: $VERSION_NAME: PyPy requires Python 2.7 to build from source. You can specify the version to use by setting the PYENV_BOOTSTRAP_VERSION environment variable." >&2
exit 1
fi
;;