mirror of
https://github.com/zebrajr/tensorflow.git
synced 2026-01-15 12:15:41 +00:00
Upgrade python 3.14.0rc1 and install python 3.14-nogil in linux docker images
PiperOrigin-RevId: 789527645
This commit is contained in:
committed by
TensorFlower Gardener
parent
ffbc76ccd0
commit
f459343d24
@@ -29,6 +29,7 @@ RUN /setup.python.sh python3.11 /builder.requirements.txt
|
|||||||
RUN /setup.python.sh python3.13 /builder.requirements.txt
|
RUN /setup.python.sh python3.13 /builder.requirements.txt
|
||||||
RUN /setup.python.sh python3.13-nogil /builder.requirements.txt
|
RUN /setup.python.sh python3.13-nogil /builder.requirements.txt
|
||||||
RUN /setup.python.sh python3.14 /builder.requirements.txt
|
RUN /setup.python.sh python3.14 /builder.requirements.txt
|
||||||
|
RUN /setup.python.sh python3.14-nogil /builder.requirements.txt
|
||||||
|
|
||||||
# Since we are using python3.12 as the default python version, we need to
|
# Since we are using python3.12 as the default python version, we need to
|
||||||
# install python3.12 last for now.
|
# install python3.12 last for now.
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ VERSION=$1
|
|||||||
REQUIREMENTS=$2
|
REQUIREMENTS=$2
|
||||||
|
|
||||||
# Install Python packages for this container's version
|
# Install Python packages for this container's version
|
||||||
if [[ ${VERSION} == "python3.13-nogil" ]]; then
|
if [[ ${VERSION} == "python3.13-nogil" || ${VERSION} == "python3.14-nogil" ]]; then
|
||||||
cat >pythons.txt <<EOF
|
cat >pythons.txt <<EOF
|
||||||
$VERSION
|
$VERSION
|
||||||
EOF
|
EOF
|
||||||
@@ -43,24 +43,7 @@ $VERSION-distutils
|
|||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${VERSION} == "python3.14" ]]; then
|
/setup.packages.sh pythons.txt
|
||||||
# Build python 3.14.0b1 from source now. This is a temporary solution until
|
|
||||||
# the apt-get install python3.14 installation is stable to use.
|
|
||||||
# TODO(kanglan): Remove this once official python 3.14 is available in astral
|
|
||||||
# python standalone build repo and the rules_python patch is updated.
|
|
||||||
apt update && apt install -y libssl-dev zlib1g-dev libbz2-dev libreadline-dev libncurses5-dev libffi-dev liblzma-dev
|
|
||||||
wget https://www.python.org/ftp/python/3.14.0/Python-3.14.0b1.tar.xz
|
|
||||||
tar -xf Python-3.14.0b1.tar.xz
|
|
||||||
pushd Python-3.14.0b1
|
|
||||||
mkdir -p /python314-0b1
|
|
||||||
CC=clang-18 CXX=clang++-18 ./configure --prefix /python314-0b1 --with-ensurepip=install
|
|
||||||
make -j$(nproc)
|
|
||||||
make install -j$(nproc)
|
|
||||||
ln -s /python314-0b1/bin/python3 /usr/bin/python3.14
|
|
||||||
popd
|
|
||||||
else
|
|
||||||
/setup.packages.sh pythons.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Re-link pyconfig.h from x86_64-linux-gnu into the devtoolset directory
|
# Re-link pyconfig.h from x86_64-linux-gnu into the devtoolset directory
|
||||||
# for any Python version present
|
# for any Python version present
|
||||||
@@ -89,8 +72,8 @@ wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=5
|
|||||||
# For Python 3.13t, do not install twine as it does not have pre-built wheels
|
# For Python 3.13t, do not install twine as it does not have pre-built wheels
|
||||||
# for this Python version and building it from source fails. We only need twine
|
# for this Python version and building it from source fails. We only need twine
|
||||||
# to be present on the system Python which in this case is 3.12.
|
# to be present on the system Python which in this case is 3.12.
|
||||||
# Same reason for Python 3.140a7.
|
# Same reason for Python 3.14.
|
||||||
if [[ ${VERSION} == "python3.13-nogil" || ${VERSION} == "python3.14" ]]; then
|
if [[ ${VERSION} == "python3.13-nogil" || ${VERSION} == "python3.14" || ${VERSION} == "python3.14-nogil" ]]; then
|
||||||
grep -v "twine" $REQUIREMENTS > requirements_without_twine.txt
|
grep -v "twine" $REQUIREMENTS > requirements_without_twine.txt
|
||||||
REQUIREMENTS=requirements_without_twine.txt
|
REQUIREMENTS=requirements_without_twine.txt
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ RUN /setup.python.sh python3.13 requirements.txt
|
|||||||
# python3.13-nogil is a free-threaded build of python3.13.
|
# python3.13-nogil is a free-threaded build of python3.13.
|
||||||
RUN /setup.python.sh python3.13-nogil requirements.txt
|
RUN /setup.python.sh python3.13-nogil requirements.txt
|
||||||
RUN /setup.python.sh python3.14 requirements.txt
|
RUN /setup.python.sh python3.14 requirements.txt
|
||||||
|
RUN /setup.python.sh python3.14-nogil requirements.txt
|
||||||
|
|
||||||
# Python commands by default run under 3.11
|
# Python commands by default run under 3.11
|
||||||
RUN ln -sf /usr/bin/python3.11 /usr/bin/python3
|
RUN ln -sf /usr/bin/python3.11 /usr/bin/python3
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ REQUIREMENTS=$2
|
|||||||
|
|
||||||
add-apt-repository ppa:deadsnakes/ppa
|
add-apt-repository ppa:deadsnakes/ppa
|
||||||
# Install Python packages for this container's version
|
# Install Python packages for this container's version
|
||||||
if [[ ${VERSION} == "python3.13-nogil" ]]; then
|
if [[ ${VERSION} == "python3.13-nogil" || ${VERSION} == "python3.14-nogil" ]]; then
|
||||||
cat >pythons.txt <<EOF
|
cat >pythons.txt <<EOF
|
||||||
$VERSION
|
$VERSION
|
||||||
EOF
|
EOF
|
||||||
@@ -43,20 +43,7 @@ $VERSION-venv
|
|||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${VERSION} == "python3.14" ]]; then
|
/setup.packages.sh pythons.txt
|
||||||
apt update && apt install -y libssl-dev zlib1g-dev libbz2-dev libreadline-dev libncurses5-dev libffi-dev liblzma-dev
|
|
||||||
wget https://www.python.org/ftp/python/3.14.0/Python-3.14.0b1.tar.xz
|
|
||||||
tar -xf Python-3.14.0b1.tar.xz
|
|
||||||
pushd Python-3.14.0b1
|
|
||||||
mkdir -p /python314-0b1
|
|
||||||
CC=clang-18 CXX=clang++-18 ./configure --prefix /python314-0b1 --with-ensurepip=install
|
|
||||||
make -j$(nproc)
|
|
||||||
make install -j$(nproc)
|
|
||||||
ln -s /python314-0b1/bin/python3 /usr/bin/python3.14
|
|
||||||
popd
|
|
||||||
else
|
|
||||||
/setup.packages.sh pythons.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Re-link pyconfig.h from aarch64-linux-gnu into the devtoolset directory
|
# Re-link pyconfig.h from aarch64-linux-gnu into the devtoolset directory
|
||||||
# for any Python version present
|
# for any Python version present
|
||||||
@@ -84,7 +71,7 @@ wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=5
|
|||||||
# For Python 3.13t, do not install twine as it does not have pre-built wheels
|
# For Python 3.13t, do not install twine as it does not have pre-built wheels
|
||||||
# for this Python version and building it from source fails. We only need twine
|
# for this Python version and building it from source fails. We only need twine
|
||||||
# to be present on the system Python which in this case is 3.12.
|
# to be present on the system Python which in this case is 3.12.
|
||||||
if [[ ${VERSION} == "python3.13-nogil" || ${VERSION} == "python3.14" ]]; then
|
if [[ ${VERSION} == "python3.13-nogil" || ${VERSION} == "python3.14" || ${VERSION} == "python3.14-nogil" ]]; then
|
||||||
grep -v "twine" $REQUIREMENTS > requirements_without_twine.txt
|
grep -v "twine" $REQUIREMENTS > requirements_without_twine.txt
|
||||||
REQUIREMENTS=requirements_without_twine.txt
|
REQUIREMENTS=requirements_without_twine.txt
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user