From 9ebeeb87a383c26589a2fb416d53a4331348a51a Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 8 Jan 2026 16:57:32 +0000 Subject: [PATCH 1/4] chore(librarian): for generation, bump python runtime to 3.14.2; drop 3.13 --- .generator/Dockerfile | 26 ++++++++++---------------- .generator/cli.py | 11 +---------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/.generator/Dockerfile b/.generator/Dockerfile index 1dfaa731eccc..2831ccffa6ce 100644 --- a/.generator/Dockerfile +++ b/.generator/Dockerfile @@ -40,27 +40,25 @@ RUN apt-get update && \ && apt-get clean && \ rm -rf /var/lib/apt/lists/* -# `make altinstall` is used to prevent replacing the system's default python binary. +ENV PYTHON_VERSION=3.14 + # The full Python version, including the minor version, is needed for download/install -# TODO(https://github.com/googleapis/librarian/issues/2945): Remove `3.13` when the linked issue is resolved. -RUN for PYTHON_VERSION_WITH_MINOR in 3.13.9 3.14.0; do \ - wget https://www.python.org/ftp/python/${PYTHON_VERSION_WITH_MINOR}/Python-${PYTHON_VERSION_WITH_MINOR}.tgz && \ +ENV PYTHON_VERSION_WITH_MINOR=3.14.2 + +# `make altinstall` is used to prevent replacing the system's default python binary. +RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION_WITH_MINOR}/Python-${PYTHON_VERSION_WITH_MINOR}.tgz && \ tar -xvf Python-${PYTHON_VERSION_WITH_MINOR}.tgz && \ cd Python-${PYTHON_VERSION_WITH_MINOR} && \ ./configure --enable-optimizations --prefix=/usr/local && \ make -j$(nproc) && \ make altinstall && \ cd / && \ - rm -rf Python-${PYTHON_VERSION_WITH_MINOR}* \ - ; done + rm -rf Python-${PYTHON_VERSION_WITH_MINOR}* + -# Install pip for each python version -# TODO(https://github.com/googleapis/librarian/issues/2945): Remove `3.13` when the linked issue is resolved. -RUN for PYTHON_VERSION in 3.13 3.14; do \ - wget --no-check-certificate -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' && \ +RUN wget --no-check-certificate -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' && \ python${PYTHON_VERSION} /tmp/get-pip.py && \ - rm /tmp/get-pip.py \ - ; done + rm /tmp/get-pip.py # Download/extract protoc RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-linux-x86_64.zip @@ -112,10 +110,6 @@ COPY --from=builder synthtool /synthtool COPY --from=builder /usr/local/bin/python${PYTHON_VERSION_DEFAULT} /usr/local/bin/ COPY --from=builder /usr/local/lib/python${PYTHON_VERSION_DEFAULT} /usr/local/lib/python${PYTHON_VERSION_DEFAULT} -# TODO(https://github.com/googleapis/librarian/issues/2945): Remove `3.13` when the linked issue is resolved. -COPY --from=builder /usr/local/bin/python3.13 /usr/local/bin -COPY --from=builder /usr/local/lib/python3.13 /usr/local/lib/python3.13 - # Set the working directory in the container. WORKDIR /app diff --git a/.generator/cli.py b/.generator/cli.py index 4559c73fc27e..ae262d4145ac 100644 --- a/.generator/cli.py +++ b/.generator/cli.py @@ -995,16 +995,7 @@ def _run_nox_sessions(library_id: str, repo: str, is_mono_repo: bool): the config.yaml. is_mono_repo(bool): True if the current repository is a mono-repo. """ - path_to_library = f"{repo}/packages/{library_id}" if is_mono_repo else repo - _python_314_supported = Path( - f"{path_to_library}/testing/constraints-3.14.txt" - ).exists() - - if _python_314_supported: - session_runtime = "3.14" - else: - session_runtime = "3.13" - + session_runtime = "3.14" sessions = [ f"unit-{session_runtime}(protobuf_implementation='upb')", ] From ace7b323778439fe61017b7a01e47af4bdb61ef4 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 8 Jan 2026 17:01:28 +0000 Subject: [PATCH 2/4] update test --- .generator/test_cli.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.generator/test_cli.py b/.generator/test_cli.py index 4a168cbc2759..a153ad1c3704 100644 --- a/.generator/test_cli.py +++ b/.generator/test_cli.py @@ -778,10 +778,8 @@ def test_run_individual_session_failure(mocker): @pytest.mark.parametrize( "is_mono_repo,py314_constraints_file_exists, nox_session_python_runtime", [ - (False, True, "3.14"), - (True, True, "3.14"), - (True, False, "3.13"), - (False, False, "3.13"), + (False, "3.14"), + (True, "3.14"), ], ) def test_run_nox_sessions_success( @@ -795,7 +793,6 @@ def test_run_nox_sessions_success( mocker.patch("cli._read_json_file", return_value=mock_generate_request_data_for_nox) mocker.patch("cli._get_library_id", return_value="mock-library") mock_run_individual_session = mocker.patch("cli._run_individual_session") - mocker.patch("pathlib.Path.exists", return_value=py314_constraints_file_exists) sessions_to_run = [ f"unit-{nox_session_python_runtime}(protobuf_implementation='upb')", From e8f34ae055d4313a5def432d72302e0f791287e1 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 8 Jan 2026 17:02:19 +0000 Subject: [PATCH 3/4] fix test --- .generator/test_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.generator/test_cli.py b/.generator/test_cli.py index a153ad1c3704..2b8df8c28cfb 100644 --- a/.generator/test_cli.py +++ b/.generator/test_cli.py @@ -776,7 +776,7 @@ def test_run_individual_session_failure(mocker): @pytest.mark.parametrize( - "is_mono_repo,py314_constraints_file_exists, nox_session_python_runtime", + "is_mono_repo, nox_session_python_runtime", [ (False, "3.14"), (True, "3.14"), From 1cefdf3aed1797019d28fe535f22ab05e218e986 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 8 Jan 2026 17:02:38 +0000 Subject: [PATCH 4/4] fix test --- .generator/test_cli.py | 1 - 1 file changed, 1 deletion(-) diff --git a/.generator/test_cli.py b/.generator/test_cli.py index 2b8df8c28cfb..16097bc5c9e2 100644 --- a/.generator/test_cli.py +++ b/.generator/test_cli.py @@ -786,7 +786,6 @@ def test_run_nox_sessions_success( mocker, mock_generate_request_data_for_nox, is_mono_repo, - py314_constraints_file_exists, nox_session_python_runtime, ): """Tests that _run_nox_sessions successfully runs all specified sessions."""