Skip to content

Remove google-genai compat shim, require 2.12+ - #1709

Closed
DABH wants to merge 1 commit into
mainfrom
google-genai-2.12-min
Closed

Remove google-genai compat shim, require 2.12+#1709
DABH wants to merge 1 commit into
mainfrom
google-genai-2.12-min

Conversation

@DABH

@DABH DABH commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

What

Follow-up to #1652, as agreed there: now that google-genai 2.12.0 is past the two-week exclude-newer window, raise the dependency floor to >=2.12.0,<3.0.0, delete the _compat.py shim, and import Interaction directly from its defining module at the three former shim call sites.

Why

The shim existed only to keep type checking working across the 2.10–2.12 range. With 2.12 as the floor, the conditional runtime/static split is unnecessary — the defining-module import (google.genai._gaos.types.interactions.interaction) is the one form that both runtime and type checkers resolve to the resource class. The public google.genai.interactions.Interaction still resolves to a TypeAliasType under type checkers on every release through 2.16.0 (verified with mypy against 2.12.1 and 2.16.0), and the upstream fix (googleapis/python-genai#2732) has not landed, so the public import can't be restored yet.

Lockfile notes: google-genai moves to 2.12.1, which also forces google-auth down to 2.55.2 (2.12.1 pins google-auth<2.56.0).

Verification

  • mypy, pyright, and basedpyright clean on temporalio/contrib/google_genai/ and tests/contrib/google_genai/ against 2.12.1
  • All 62 tests/contrib/google_genai/ tests pass against 2.12.1

google-genai 2.12.0 is now past the two-week exclude-newer window, so the
dependency floor can move to >=2.12.0 and the _compat.py shim from #1652
is no longer needed. Interaction is imported from its defining module,
which both runtime and type checkers resolve to the resource class
(the public google.genai.interactions.Interaction still resolves to a
TypeAliasType for type checkers; tracked upstream in
googleapis/python-genai#2732).

Lockfile: google-genai 2.11.0 -> 2.12.1; google-auth downgraded to
2.55.2 per 2.12.1's google-auth<2.56.0 constraint.
@DABH
DABH requested review from a team as code owners July 31, 2026 19:15
import pytest
from google.genai import Client as GeminiClient
from google.genai import types
from google.genai._gaos.types.interactions.interaction import Interaction

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're using internal imports to fix this?

@DABH

DABH commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Don't really like internal imports, don't think this improves quality over using a shim. Going to close this and just wait for Google to fix the root issue upstream so we don't need shims or internal imports. Then will do the real PR I want (no shims or internal imports) down the line.

@DABH DABH closed this Jul 31, 2026
@DABH
DABH deleted the google-genai-2.12-min branch July 31, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants