Skip to content
Snippets Groups Projects
Unverified Commit 85bc99a3 authored by Ramesh Sampath's avatar Ramesh Sampath Committed by GitHub
Browse files

Add Python 3.10 support (#58)

Adds Python 3.10 support to the containers. Python 3.10 changes some library behavior and, for now, needs an alternative installation method to work.
parent 467e5a79
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [python3.7, python3.8, python3.9]
python-version: [python3.7, python3.8, python3.9, python3.10]
steps:
-
name: Checkout
......@@ -54,6 +54,7 @@ jobs:
message: |
I pushed these containers:
- `gcr.io/tensorflow-sigs/build:${{ github.event.number }}-python3.10`
- `gcr.io/tensorflow-sigs/build:${{ github.event.number }}-python3.9`
- `gcr.io/tensorflow-sigs/build:${{ github.event.number }}-python3.8`
- `gcr.io/tensorflow-sigs/build:${{ github.event.number }}-python3.7`
......
......@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [python3.7, python3.8, python3.9]
python-version: [python3.7, python3.8, python3.9, python3.10]
steps:
-
name: Checkout
......
......@@ -80,6 +80,7 @@ Now let's build `tf-nightly`.
Hub](https://hub.docker.com/r/tensorflow/build/tags). The options for the
`master` branch are:
- `tensorflow/build:latest-python3.10`
- `tensorflow/build:latest-python3.9`
- `tensorflow/build:latest-python3.8`
- `tensorflow/build:latest-python3.7`
......
......@@ -132,7 +132,7 @@ cp "./x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++_nonshared44.a" \
# TODO(klimek): Automate linking in all non-gcc / non-kernel include
# directories.
mkdir -p "/${TARGET}/usr/include/x86_64-linux-gnu"
PYTHON_VERSIONS=("python3.7m" "python3.8" "python3.9")
PYTHON_VERSIONS=("python3.7m" "python3.8" "python3.9" "python3.10")
for v in "${PYTHON_VERSIONS[@]}"; do
ln -s "/usr/local/include/${v}" "/${TARGET}/usr/include/x86_64-linux-gnu/${v}"
done
......
......@@ -9,9 +9,9 @@ absl-py ~= 0.13.0
astunparse ~= 1.6.3
flatbuffers ~= 2.0
google_pasta ~= 0.2
h5py ~= 3.1.0
h5py ~= 3.6.0
keras_preprocessing ~= 1.1.2
numpy ~= 1.19.5
numpy ~= 1.21.4
opt_einsum ~= 3.3.0
protobuf >= 3.17.1
six ~= 1.16.0
......@@ -34,9 +34,10 @@ tf-estimator-nightly ~= 2.8.0.dev
# Test dependencies
grpcio ~= 1.38.1
portpicker ~= 1.4.0
scipy ~= 1.5.4
jax ~= 0.2.18
jaxlib ~= 0.1.70
scipy ~= 1.7.3
# Required for TFLite import from JAX tests
jax ~= 0.2.26
jaxlib ~= 0.1.75
# Needs to be addressed. Unblocked 2.4 branchcut cl/338377048
PyYAML ~= 5.4.1
......
......@@ -33,9 +33,22 @@ ln -sf /usr/bin/$VERSION /usr/bin/python
ln -sf /usr/lib/$VERSION /usr/lib/tf_python
# Install pip
if [[ "$VERSION" == "python3.10" ]]; then
# Python 3.10 pip reference is broken for pip 21.3 (https://github.com/pypa/pip/issues/10647)
# TODO(rameshsampath): Remove once Python 3.10 works with latest pip
# Don't update the pip after installed with ensurepip.
# ensurepip only installs pip3 command. Alias pip to pip3
python3 -m ensurepip
PIP=/usr/local/bin/pip
if [[ -f "$PIP" ]]; then
rm $PIP
fi
ln -s $(which pip3) $PIP
else
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
python3 -m pip install --no-cache-dir --upgrade pip
fi
# Disable the cache dir to save image space, and install packages
python3 -m pip install --no-cache-dir --upgrade pip
python3 -m pip install --no-cache-dir -r $REQUIREMENTS -U
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment