Skip to content

Commit 13c3c2f

Browse files
authored
chore(genai): move blocked Gen AI sample directories to Python 3.12 and google-genai 2.34.0 (#14812)
These directories can't upgrade to google-genai 3.0.0 yet: they use features that only `google-cloud-aiplatform` provides (Vertex AI Pipelines, the Gen AI evaluation service, and RAG Engine), and every `google-cloud-aiplatform` release, including the latest, requires `google-genai<3.0.0`. They still tested on Python 3.10 (end of life) and 3.14 or 3.11. Changes: - Directories: genai/embeddings, genai/evaluation, genai/model_tuning, generative_ai/rag, and the Dataflow flex template `pipeline_with_dependencies` (where google-genai is a transitive dependency of `apache-beam[gcp]`). - Test on Python 3.12 (3.14 unchanged). Dataflow already tests 3.13. - Pin `google-genai==2.34.0` (the latest 2.x), with a comment in each `requirements.txt` explaining why the directory stays on 2.x. - genai/evaluation: bump `google-auth` 2.55.2 → 2.62.2 (2.34.0 requires 2.56.0 or later). - generative_ai/rag: bump `pytest-asyncio` 0.23.6 → 1.4.0. 0.23.6 requires `pytest<9`, which conflicts with the pinned `pytest==9.0.3`, so the test requirements couldn't be installed. - Dataflow: regenerate `requirements.txt` with `pip-compile --upgrade-package google-genai==2.34.0` (one-line change). Testing: Live tests ran against a Google Cloud test project on Python 3.12. Every directory with a failure was also run with the pins from `main`: no test that passes on `main` fails with these changes. Remaining failures are listed below and also fail on `main`. - embeddings 7/7 and model_tuning 2/2 pass (same as `main`). - evaluation 0/1, the same as `main` (`gemini-2.5-flash` isn't available in `global` in the test project). - rag: the tests skip themselves (issue #11557). Run with the skip removed: 8 of 16 pass, the same as with `main`'s pins. The other 8 fail the same way on `main` (third-party vector database corpus samples, and test data in another project).
1 parent b48ece3 commit 13c3c2f

10 files changed

Lines changed: 15 additions & 11 deletions

File tree

‎dataflow/flex-templates/pipeline_with_dependencies/requirements.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ google-crc32c==1.9.0
176176
# google-cloud-bigtable
177177
# google-cloud-storage
178178
# google-resumable-media
179-
google-genai==2.30.1
179+
google-genai==2.34.0
180180
# via google-cloud-aiplatform
181181
google-resumable-media==2.11.0
182182
# via

‎genai/embeddings/noxfile_config.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
TEST_CONFIG_OVERRIDE = {
2424
# You can opt out from the test for specific Python versions.
25-
"ignored_versions": ["3.8", "3.9", "3.11", "3.12", "3.13"],
25+
"ignored_versions": ["3.8", "3.9", "3.10", "3.11", "3.13"],
2626
# Old samples are opted out of enforcing Python type hints
2727
# All new samples should feature them
2828
"enforce_type_hints": True,

‎genai/embeddings/requirements.txt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
google-genai==2.16.0
1+
# google-genai stays on 2.x: google-cloud-aiplatform (Vertex AI Pipelines) requires google-genai<3.0.0.
2+
google-genai==2.34.0
23
google-cloud-aiplatform[pipelines]==1.163.0

‎genai/evaluation/noxfile_config.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
TEST_CONFIG_OVERRIDE = {
2424
# You can opt out from the test for specific Python versions.
25-
"ignored_versions": ["3.8", "3.9", "3.10", "3.12", "3.13"],
25+
"ignored_versions": ["3.8", "3.9", "3.10", "3.11", "3.13"],
2626
# Old samples are opted out of enforcing Python type hints
2727
# All new samples should feature them
2828
"enforce_type_hints": True,

‎genai/evaluation/requirements.txt‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
pandas==2.3.3
2-
google-auth==2.55.2
2+
google-auth==2.62.2
33
google-cloud-aiplatform[evaluation]==1.161.0
4-
google-genai==2.12.1
4+
# google-genai stays on 2.x: google-cloud-aiplatform (Gen AI evaluation service) requires google-genai<3.0.0.
5+
google-genai==2.34.0

‎genai/model_tuning/noxfile_config.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
TEST_CONFIG_OVERRIDE = {
2424
# You can opt out from the test for specific Python versions.
25-
"ignored_versions": ["3.8", "3.9", "3.11", "3.12", "3.13"],
25+
"ignored_versions": ["3.8", "3.9", "3.10", "3.11", "3.13"],
2626
# Old samples are opted out of enforcing Python type hints
2727
# All new samples should feature them
2828
"enforce_type_hints": True,
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
google-genai==2.16.0
1+
# google-genai stays on 2.x: google-cloud-aiplatform (Gen AI evaluation service) requires google-genai<3.0.0.
2+
google-genai==2.34.0
23
google-cloud-aiplatform[pipelines, evaluation]==1.163.0

‎generative_ai/rag/noxfile_config.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
TEST_CONFIG_OVERRIDE = {
2424
# You can opt out from the test for specific Python versions.
25-
"ignored_versions": ["3.8", "3.9", "3.11", "3.12", "3.13"],
25+
"ignored_versions": ["3.8", "3.9", "3.10", "3.11", "3.13"],
2626
# Old samples are opted out of enforcing Python type hints
2727
# All new samples should feature them
2828
"enforce_type_hints": True,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
backoff==2.2.1
22
google-api-core==2.19.0
33
pytest==9.0.3; python_version >= "3.10"
4-
pytest-asyncio==0.23.6
4+
pytest-asyncio==1.4.0

‎generative_ai/rag/requirements.txt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
google-cloud-aiplatform==2.6.0
2-
google-genai==2.29.0
2+
# google-genai stays on 2.x: google-cloud-aiplatform (RAG Engine) requires google-genai<3.0.0.
3+
google-genai==2.34.0

0 commit comments

Comments
 (0)