@@ -162,10 +162,16 @@ def cythonize(*args, **kwargs):
162162
163163milvus_dependency = ['pymilvus>=2.5.10,<3.0.0' ]
164164
165- ml_base = [
165+ # google-adk / OpenTelemetry require protobuf>=5; tensorflow-transform in
166+ # ml_test is pinned to versions that require protobuf<5 on Python 3.10. Those
167+ # cannot be installed together, so ADK deps stay out of ml_test (use ml_base).
168+ ml_base_core = [
166169 'embeddings>=0.0.4' , # 0.0.3 crashes setuptools
167- 'google-adk' ,
168170 'onnxruntime' ,
171+ # onnx 1.12–1.13 cap protobuf in ways that trigger huge backtracking with
172+ # Beam[gcp]+ml_test; pip can fall back to onnx 1.11 sdist which needs cmake.
173+ # 1.14.1+ matches tf2onnx>=1.16 and ships manylinux wheels for py3.10.
174+ 'onnx>=1.14.1,<2' ,
169175 'langchain' ,
170176 'sentence-transformers>=2.2.2' ,
171177 'skl2onnx' ,
@@ -174,11 +180,21 @@ def cythonize(*args, **kwargs):
174180 # tensorflow transitive dep, lower versions not compatible with Python3.10+
175181 'absl-py>=0.12.0' ,
176182 'tensorflow-hub' ,
177- 'tf2onnx' ,
178183 'torch' ,
179184 'transformers' ,
180185]
181186
187+ ml_adk_dependency = [
188+ 'google-adk==1.17.0' ,
189+ 'opentelemetry-api==1.37.0' ,
190+ 'opentelemetry-sdk==1.37.0' ,
191+ 'opentelemetry-exporter-otlp-proto-http==1.37.0' ,
192+ # protobuf>=5 (ADK/OTel); tf2onnx 1.16.x pins protobuf~=3.20 only.
193+ 'tf2onnx>=1.17.0,<1.18' ,
194+ ]
195+
196+ ml_base = ml_base_core + ml_adk_dependency
197+
182198
183199def find_by_ext (root_dir , ext ):
184200 for root , _ , files in os .walk (root_dir ):
@@ -392,7 +408,10 @@ def get_portability_package_data():
392408 'packaging>=22.0' ,
393409 'pillow>=12.1.1,<13' ,
394410 'pymongo>=3.8.0,<5.0.0' ,
395- 'proto-plus>=1.7.1,<2' ,
411+ # proto-plus<1.24 requires protobuf<5; opentelemetry-proto
412+ # (google-adk) needs protobuf>=5. 1.26.1 allows protobuf<7
413+ # (matches Beam's cap).
414+ 'proto-plus>=1.26.1,<2' ,
396415 # 1. Use a tighter upper bound in protobuf dependency to make sure
397416 # the minor version at job submission
398417 # does not exceed the minor version at runtime.
@@ -547,14 +566,14 @@ def get_portability_package_data():
547566 # TFT->TFX-BSL require pandas 1.x, which is not compatible
548567 # with numpy 2.x
549568 'numpy<2' ,
550- # To help with dependency resolution in test suite. Revise once
551- # https://github.com/apache/beam/issues/37854 is fixed
552- 'protobuf<4; python_version<"3.11"'
553569 # Comment out xgboost as it is breaking presubmit python ml
554570 # tests due to tag check introduced since pip 24.2
555571 # https://github.com/apache/beam/issues/31285
556572 # 'xgboost<2.0', # https://github.com/apache/beam/issues/31252
557- ] + ml_base ,
573+ # tft needs protobuf<5; tf2onnx 1.17+ allows protobuf 5 on the
574+ # ADK-only path.
575+ 'tf2onnx>=1.16.1,<1.17' ,
576+ ] + ml_base_core ,
558577 'p310_ml_test' : [
559578 'datatable' ,
560579 ] + ml_base ,
0 commit comments