Skip to content

Commit d8d22a8

Browse files
morambrocopybara-github
authored andcommitted
Add support for Python 3.13.
#41 PiperOrigin-RevId: 748323022 Change-Id: Ifa23b7ddfa3599ee908f5c2e24f1c1b423de8f21
1 parent ea050d5 commit d8d22a8

File tree

10 files changed

+43
-21
lines changed

10 files changed

+43
-21
lines changed

examples/WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ load("@rules_python//python:repositories.bzl", "py_repositories", "python_regist
2828
py_repositories()
2929

3030
python_register_toolchains(
31-
name = "python_3_12",
31+
name = "python_3_13",
3232
ignore_root_user_error = True,
33-
python_version = "3.12",
33+
python_version = "3.13",
3434
)
3535

3636
load("@tink_cc//:tink_cc_deps.bzl", "tink_cc_deps")

kokoro/gcp_windows/release/bdist/create/run.bat

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ CD !WORKSPACE_DIR!
2323
IF %errorlevel% neq 0 EXIT /B 1
2424

2525
@REM Install protoc.
26-
choco install -y --no-progress protoc --version=25.2.0
26+
choco install -y --no-progress protoc --version=30.2.0
2727
SET OLD_PATH=%PATH%
2828

2929
SET /p TINK_VERSION=<VERSION
@@ -52,7 +52,11 @@ CALL :UsePython "3.11.9" "311" || GOTO :Error
5252
CALL :BuildAndInstallWheel || GOTO :Error
5353
CALL :RunTests || GOTO :Error
5454

55-
CALL :UsePython "3.12.3" "312" || GOTO :Error
55+
CALL :UsePython "3.12.9" "312" || GOTO :Error
56+
CALL :BuildAndInstallWheel || GOTO :Error
57+
CALL :RunTests || GOTO :Error
58+
59+
CALL :UsePython "3.13.3" "313" || GOTO :Error
5660
CALL :BuildAndInstallWheel || GOTO :Error
5761
CALL :RunTests || GOTO :Error
5862

kokoro/macos_external/bazel/run_tests.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,15 @@ if [[ -n "${KOKORO_ROOT:-}" ]]; then
2929
cd "${TINK_BASE_DIR}/tink_py"
3030
fi
3131

32-
# Make sure we use the latest Python 3.12 available with pyenv.
33-
eval "$(pyenv init -)"
34-
pyenv install -s "3.12"
35-
pyenv global "3.12"
32+
# Make sure we use the latest Python 3.13 available with pyenv.
33+
# The macOS image exports a PYENV_ROOT env variable.
34+
(
35+
cd "${PYENV_ROOT:-"${HOME}/.pyenv"}"
36+
git pull
37+
eval "$(pyenv init -)"
38+
pyenv install -s "3.13"
39+
pyenv global "3.13"
40+
)
3641

3742
./kokoro/testutils/copy_credentials.sh "testdata" "all"
3843
./kokoro/testutils/copy_credentials.sh "examples/testdata" "gcp"

kokoro/macos_external/pip/run_tests.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,15 @@ if [[ -n "${KOKORO_ROOT:-}" ]]; then
3535
cd "${TINK_BASE_DIR}/tink_py"
3636
fi
3737

38-
# Make sure we use the latest Python 3.12 available with pyenv.
39-
eval "$(pyenv init -)"
40-
pyenv install -s "3.12"
41-
pyenv global "3.12"
38+
# Make sure we use the latest Python 3.13 available with pyenv.
39+
# The macOS image exports a PYENV_ROOT env variable.
40+
(
41+
cd "${PYENV_ROOT:-"${HOME}/.pyenv"}"
42+
git pull
43+
eval "$(pyenv init -)"
44+
pyenv install -s "3.13"
45+
pyenv global "3.13"
46+
)
4247

4348
# Sourcing required to update callers environment.
4449
source ./kokoro/testutils/install_protoc.sh "30.2"

kokoro/macos_external/release/bdist/create/run.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ if [[ -n "${TINK_REMOTE_BAZEL_CACHE_GCS_BUCKET:-}" ]]; then
4242
fi
4343
readonly CREATE_DIST_OPTIONS
4444

45+
# Update pyenv.
46+
# The macOS image exports a PYENV_ROOT env variable.
47+
(
48+
cd "${PYENV_ROOT:-"${HOME}/.pyenv"}"
49+
git pull
50+
)
51+
4552
# Sourcing required to update callers environment.
4653
source ./kokoro/testutils/install_protoc.sh "30.2"
4754

kokoro/testutils/py_test_container_images.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ _image_prefix() {
2525

2626
# Linux x86_64 container image.
2727
readonly TINK_PY_BASE_IMAGE_NAME="linux-tink-py-base"
28-
readonly TINK_PY_BASE_IMAGE_HASH="32c19ce721994942c2f8a6bfa99bd193d6bbd8a3edbb466b8a965501e4ae8b04"
28+
readonly TINK_PY_BASE_IMAGE_HASH="eb0e710d9e61a238ae193535cf4c06d9b77b27d67392b701db55fba2b0b88223"
2929
readonly TINK_PY_BASE_IMAGE="$(_image_prefix)/${TINK_PY_BASE_IMAGE_NAME}@sha256:${TINK_PY_BASE_IMAGE_HASH}"
3030

3131
# Linux arm64 container image.
3232
readonly TINK_PY_BASE_ARM64_IMAGE_NAME="linux-tink-py-base-arm64"
33-
readonly TINK_PY_BASE_ARM64_IMAGE_HASH="760df76aed0bc189b9d2e3b2e4f5926244ca021263d7375485f705c96840023b"
33+
readonly TINK_PY_BASE_ARM64_IMAGE_HASH="c96f37e417d2b2b1454b2ad78a03c91b23b4f76678d9b5b9adf34b88ac48309f"
3434
readonly TINK_PY_BASE_ARM64_IMAGE="$(_image_prefix)/${TINK_PY_BASE_ARM64_IMAGE_NAME}@sha256:${TINK_PY_BASE_ARM64_IMAGE_HASH}"
3535

3636
unset -f _image_prefix

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ def main() -> None:
251251
'Programming Language :: Python :: 3.10',
252252
'Programming Language :: Python :: 3.11',
253253
'Programming Language :: Python :: 3.12',
254+
'Programming Language :: Python :: 3.13',
254255
'Topic :: Software Development :: Libraries',
255256
],
256257
options=options(),

tink_py_deps.bzl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@ def tink_py_deps():
4040
},
4141
)
4242

43-
# Release from 2024-02-13
4443
maybe(
4544
http_archive,
4645
name = "rules_python",
47-
sha256 = "c68bdc4fbec25de5b5493b8819cfc877c4ea299c0dcb15c244c5a00208cde311",
48-
strip_prefix = "rules_python-0.31.0",
49-
url = "https://github.com/bazelbuild/rules_python/releases/download/0.31.0/rules_python-0.31.0.tar.gz",
46+
sha256 = "4f7e2aa1eb9aa722d96498f5ef514f426c1f55161c3c9ae628c857a7128ceb07",
47+
strip_prefix = "rules_python-1.0.0",
48+
url = "https://github.com/bazelbuild/rules_python/releases/download/1.0.0/rules_python-1.0.0.tar.gz",
5049
)
5150

5251
# Release from 2023-07-17

tools/distribution/build_linux_binary_wheels.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ PYTHON_VERSIONS["3.9"]="cp39-cp39"
3131
PYTHON_VERSIONS["3.10"]="cp310-cp310"
3232
PYTHON_VERSIONS["3.11"]="cp311-cp311"
3333
PYTHON_VERSIONS["3.12"]="cp312-cp312"
34+
PYTHON_VERSIONS["3.13"]="cp313-cp313"
3435
readonly -A PYTHON_VERSIONS
3536

3637
export TINK_PYTHON_ROOT_PATH="${PWD}"

tools/distribution/create_bdist.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ set -eEuox pipefail
2020

2121
readonly GCS_URL="https://storage.googleapis.com"
2222

23-
readonly PYTHON_VERSIONS=( "3.9" "3.10" "3.11" "3.12" )
23+
readonly PYTHON_VERSIONS=( "3.9" "3.10" "3.11" "3.12" "3.13" )
2424

2525
readonly PLATFORM="$(uname | tr '[:upper:]' '[:lower:]')"
2626

2727
export TINK_PYTHON_ROOT_PATH="${PWD}"
2828

2929
readonly MANYLINUX_X86_64_IMAGE_NAME="quay.io/pypa/manylinux2014_x86_64"
30-
readonly MANYLINUX_X86_64_IMAGE_SHA256="sha256:2f9e5abda045d41f5418216fe7601cf12249989b9aba0a83d009b8cc434cb220"
30+
readonly MANYLINUX_X86_64_IMAGE_SHA256="sha256:a88c482d5403f0fe91836f48a37828ef1520c3a548715dd0d7f20c0c1d4d34e0"
3131
readonly MANYLINUX_X86_64_IMAGE="${MANYLINUX_X86_64_IMAGE_NAME}@${MANYLINUX_X86_64_IMAGE_SHA256}"
3232

3333
readonly MANYLINUX_AARCH64_IMAGE_NAME="quay.io/pypa/manylinux2014_aarch64"
34-
readonly MANYLINUX_AARCH64_IMAGE_SHA256="sha256:8fd5c58bf1c6a217cddd711144e25af433f2e1f5928245b6e2476affb5d1a76b"
34+
readonly MANYLINUX_AARCH64_IMAGE_SHA256="sha256:a4f98ac4c63be3566e8af2b0dcec65d99937c886e9fd6931a3ded224a451ec63"
3535
readonly MANYLINUX_AARCH64_IMAGE="${MANYLINUX_AARCH64_IMAGE_NAME}@${MANYLINUX_AARCH64_IMAGE_SHA256}"
3636

3737
readonly ARCH="$(uname -m)"

0 commit comments

Comments
 (0)