Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/google/adk/cli/cli_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def _resolve_python_version_from_agent_config(

Supports three sources, in increasing precedence:

1. The default, ``3.11``.
1. The default, ``3.12``.
2. Top-level ``python_version`` in ``.agent_engine_config.json`` (popped so
it is not forwarded to the Agent Engine API, which ignores it when the
image is built from a Dockerfile).
Expand Down
16 changes: 8 additions & 8 deletions src/google/adk/cli/cli_tools_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,11 @@ def deploy_options(command: _F) -> _F:
click.option(
"--python_version",
type=str,
default="3.11",
default="3.12",
show_default=True,
help=(
"Optional. The Python version used in the container image"
" (default: 3.11)."
" (default: 3.12)."
),
),
click.argument(
Expand Down Expand Up @@ -2741,7 +2741,7 @@ def cli_deploy_cloud_run(
provider_args: tuple[str, ...] = (),
env: tuple[str, ...] = (),
extra_packages: tuple[str, ...] = (),
python_version: str = "3.11",
python_version: str = "3.12",
) -> None:
"""Deploys an agent to Cloud Run.

Expand Down Expand Up @@ -2825,7 +2825,7 @@ def cli_deploy_docker(
a2a: bool = False,
provider_args: tuple[str, ...] = (),
env: tuple[str, ...] = (),
python_version: str = "3.11",
python_version: str = "3.12",
) -> None:
"""Deploys an agent to a local Docker container."""
_warn_if_with_ui(with_ui)
Expand Down Expand Up @@ -3128,7 +3128,7 @@ def cli_migrate_session(
"Optional. The Python version used in the container image. Overrides"
" `python_version` in `.agent_engine_config.json` when both are set."
" (default: `python_version` from `.agent_engine_config.json`, or"
" 3.11)"
" 3.12)"
),
)
@click.option(
Expand Down Expand Up @@ -3399,11 +3399,11 @@ def cli_deploy_agent_engine(
@click.option(
"--python_version",
type=str,
default="3.11",
default="3.12",
show_default=True,
help=(
"Optional. The Python version used in the container image"
" (default: 3.11)."
" (default: 3.12)."
),
)
# Kept as raw str (not parsed to list) — interpolated directly into Dockerfile CMD.
Expand Down Expand Up @@ -3482,7 +3482,7 @@ def cli_deploy_gke(
trigger_oidc_audience: str | None = None,
trigger_oidc_service_accounts: str | None = None,
extra_packages: tuple[str, ...] = (),
python_version: str = "3.11",
python_version: str = "3.12",
) -> None:
"""Deploys an agent to GKE.

Expand Down
4 changes: 2 additions & 2 deletions src/google/adk/cli/deployers/_dockerfile_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
r'^[A-Za-z0-9_-][A-Za-z0-9_.-]{0,62}$'
)

_DEFAULT_PYTHON_VERSION: Final[str] = '3.11'
_DEFAULT_PYTHON_VERSION: Final[str] = '3.12'

_PYTHON_VERSION_PATTERN: Final[re.Pattern[str]] = re.compile(
r'^3\.(1[1-9]|[2-9][0-9])(\.[0-9]+)?$'
Expand Down Expand Up @@ -250,7 +250,7 @@ def _render_dockerfile(
express_mode_option: `--express_mode` or an empty string.
extra_packages_copy: Extra `COPY`/`ENV` instructions, or an empty string.
extra_env_vars: Extra `ENV` lines, or an empty string.
python_version: The Python version for the base image (default: '3.11').
python_version: The Python version for the base image (default: '3.12').

Returns:
The Dockerfile contents.
Expand Down
8 changes: 4 additions & 4 deletions tests/unittests/cli/utils/test_cli_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3152,15 +3152,15 @@ def test_to_agent_engine_renders_python_version_and_pops_config_key(
assert "python_version" not in captured[0]


@pytest.mark.parametrize("cli_python_version", ["3.11", "3.13"])
@pytest.mark.parametrize("cli_python_version", ["3.12", "3.13"])
def test_to_agent_engine_cli_python_version_overrides_config_file(
monkeypatch: pytest.MonkeyPatch,
agent_dir: Callable[[bool, bool], Path],
cli_python_version: str,
) -> None:
"""An explicit python_version wins over .agent_engine_config.json.

Covers both the value that equals the built-in default (3.11) and a
Covers both the value that equals the built-in default (3.12) and a
different one, so the override cannot depend on a default sentinel.
"""
monkeypatch.setattr(shutil, "rmtree", _Recorder())
Expand Down Expand Up @@ -3194,7 +3194,7 @@ def test_to_agent_engine_defaults_python_version_without_flag_or_config(
monkeypatch: pytest.MonkeyPatch,
agent_dir: Callable[[bool, bool], Path],
) -> None:
"""With neither the flag nor a config key, the image is built on 3.11."""
"""With neither the flag nor a config key, the image is built on 3.12."""
monkeypatch.setattr(shutil, "rmtree", _Recorder())
captured: List[Dict[str, Any]] = []
recording_agentplatform = _make_recording_agentplatform(captured)
Expand All @@ -3215,7 +3215,7 @@ def test_to_agent_engine_defaults_python_version_without_flag_or_config(
)

dockerfile_content = (tmp_dir / "Dockerfile").read_text()
assert "FROM python:3.11-slim" in dockerfile_content
assert "FROM python:3.12-slim" in dockerfile_content


def test_to_agent_engine_rejects_non_string_python_version_in_config(
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/cli/utils/test_cli_deploy_to_cloud_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def test_to_cloud_run_happy_path(
assert "--with_ui" not in cmd_argv
assert "--port=8080" in cmd_argv
assert cmd_argv[-1] == "/app/agents"
assert "FROM python:3.11-slim" in dockerfile_content
assert "FROM python:3.12-slim" in dockerfile_content
assert (
'RUN adduser --disabled-password --gecos "" myuser' in dockerfile_content
)
Expand Down
Loading