Skip to content

Commit

Permalink
Upgrade PI to 3.14.0a4.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Jan 18, 2025
1 parent edad1b1 commit 67b8a60
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 16 deletions.
45 changes: 30 additions & 15 deletions docker/base/install_pythons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,42 @@

set -xeuo pipefail

export PYENV_ROOT=/pyenv


# N.B.: The 1st listed version will supply the default `python` on the PATH; otherwise order does
# not matter.
# See: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
DEADSNAKES_VERSIONS=(
"3.11 {dev,venv,distutils}=3.11.11"
"3.7 {dev,venv,distutils}=3.7.17"
"3.8 {dev,venv,distutils}=3.8.20"
"3.9 {dev,venv,distutils}=3.9.21"
"3.10 {dev,venv,distutils}=3.10.16"
"3.13 {dev,venv}=3.13.1"
"3.14 {dev,venv}=3.14.0~a4"
)

DEBIAN_FRONTEND=noninteractive apt install --yes software-properties-common
add-apt-repository --yes --ppa deadsnakes
for entry in "${DEADSNAKES_VERSIONS[@]}"; do
version="${entry/ */}"
packages="${entry/* /}*"
DEBIAN_FRONTEND=noninteractive apt install --yes $(eval echo python${version}-${packages})

# Let the 1st version supply the default `python`.
if [[ ! -e "/usr/bin/python" ]]; then
ln -s "$(which "python${version}")" "/usr/bin/python"
fi
done
add-apt-repository --yes --remove --ppa deadsnakes
DEBIAN_FRONTEND=noninteractive apt remove --yes software-properties-common
DEBIAN_FRONTEND=noninteractive apt autoremove --yes

export PYENV_ROOT="/pyenv"

PYENV_VERSIONS=(
3.11.11
2.7.18
3.5.10
3.6.15
3.7.17
3.8.20
3.9.21
3.10.16
3.12.8
3.13.1
3.14.0a3
pypy2.7-7.3.17
pypy3.5-7.0.0
pypy3.6-7.3.3
Expand All @@ -27,7 +46,7 @@ PYENV_VERSIONS=(
pypy3.9-7.3.16
pypy3.10-7.3.17
)
git clone "${PYENV_REPO:-https://github.com/pyenv/pyenv.git}" "${PYENV_ROOT}" && (
git clone --depth 1 "${PYENV_REPO:-https://github.com/pyenv/pyenv}" "${PYENV_ROOT}" && (
cd "${PYENV_ROOT}" && git checkout "${PYENV_SHA:-HEAD}" && src/configure && make -C src
)
PATH="${PATH}:${PYENV_ROOT}/bin"
Expand All @@ -43,9 +62,5 @@ for version in "${PYENV_VERSIONS[@]}"; do
exit 1
fi

# Let the 1st version supply the default `python`.
if [[ ! -e "/usr/bin/python" ]]; then
ln -s "${exe_path}" "/usr/bin/python"
fi
ln -s "${exe_path}" "/usr/bin/${exe}"
done
4 changes: 3 additions & 1 deletion testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,9 @@ def bootstrap_python_installer(dest):
# type: (str) -> None
for index in range(3):
try:
subprocess.check_call(args=["git", "clone", "https://github.com/pyenv/pyenv", dest])
subprocess.check_call(
args=["git", "clone", "--depth", "1", "https://github.com/pyenv/pyenv", dest]
)
return
except subprocess.CalledProcessError as e:
print("Error cloning pyenv on attempt", index + 1, "of 3:", e, file=sys.stderr)
Expand Down

0 comments on commit 67b8a60

Please sign in to comment.