Skip to content

Commit af81a0c

Browse files
authored
Fix ml_base dependency (#37721)
* Fix ml_base dependency * install twice
1 parent 342de16 commit af81a0c

2 files changed

Lines changed: 24 additions & 10 deletions

File tree

buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3166,14 +3166,16 @@ class BeamModulePlugin implements Plugin<Project> {
31663166
def distTarBall = "${pythonRootDir}/build/apache-beam.tar.gz"
31673167
def packages = "gcp,test,aws,azure,dataframe"
31683168
def extra = project.findProperty('beamPythonExtra')
3169-
if (extra) {
3170-
packages += ",${extra}"
3171-
}
3172-
31733169
project.exec {
31743170
executable 'sh'
31753171
args '-c', ". ${project.ext.envdir}/bin/activate && pip install --pre --retries 10 ${distTarBall}[${packages}]"
31763172
}
3173+
if (extra) {
3174+
project.exec {
3175+
executable 'sh'
3176+
args '-c', ". ${project.ext.envdir}/bin/activate && pip install --pre --retries 10 ${distTarBall}[${extra}]"
3177+
}
3178+
}
31773179
}
31783180
}
31793181

sdks/python/setup.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,15 @@ def cythonize(*args, **kwargs):
163163
milvus_dependency = ['pymilvus>=2.5.10,<3.0.0']
164164

165165
ml_base = [
166-
'embeddings',
166+
'embeddings>=0.0.4', # 0.0.3 crashes setuptools
167167
'onnxruntime',
168168
'langchain',
169169
'sentence-transformers>=2.2.2',
170170
'skl2onnx',
171-
'pyod',
171+
'pyod>=0.7.6', # 0.7.5 crashes setuptools
172172
'tensorflow',
173+
# tensorflow transient dep, lower versions not compatible with Python3.10+
174+
'absl-py>=0.12.0',
173175
'tensorflow-hub',
174176
'tf2onnx',
175177
'torch',
@@ -547,10 +549,12 @@ def get_portability_package_data():
547549
# tests due to tag check introduced since pip 24.2
548550
# https://github.com/apache/beam/issues/31285
549551
# 'xgboost<2.0', # https://github.com/apache/beam/issues/31252
550-
] + ml_base + milvus_dependency,
552+
] + ml_base,
551553
'p312_ml_test': [
552554
'datatable',
553555
] + ml_base,
556+
# maintainer: milvus tests only run with this extension. Make sure it
557+
# is covered by docker-in-docker test when changing py version
554558
'p313_ml_test': ml_base + milvus_dependency,
555559
'aws': ['boto3>=1.9,<2'],
556560
'azure': [
@@ -584,7 +588,11 @@ def get_portability_package_data():
584588
# For more info, see
585589
# https://docs.google.com/document/d/1c84Gc-cZRCfrU8f7kWGsNR2o8oSRjCM-dGHO9KvPWPw/edit?usp=sharing
586590
'torch': ['torch>=1.9.0,<2.8.0'],
587-
'tensorflow': ['tensorflow>=2.12rc1,<2.21'],
591+
'tensorflow': [
592+
'tensorflow>=2.12rc1,<2.21',
593+
# tensorflow transitive dep
594+
'absl-py>=0.12.0'
595+
],
588596
'transformers': [
589597
'transformers>=4.28.0,<4.56.0',
590598
'tensorflow>=2.12.0',
@@ -593,7 +601,9 @@ def get_portability_package_data():
593601
'ml_cpu': [
594602
'tensorflow>=2.12.0',
595603
'torch==2.8.0+cpu',
596-
'transformers>=4.28.0,<4.56.0'
604+
'transformers>=4.28.0,<4.56.0',
605+
# tensorflow transient dep
606+
'absl-py>=0.12.0'
597607
],
598608
'redis': ['redis>=5.0.0,<6'],
599609
'tft': [
@@ -610,7 +620,9 @@ def get_portability_package_data():
610620
'tensorflow==2.11.0',
611621
'tf2onnx==1.13.0',
612622
'skl2onnx==1.13',
613-
'transformers==4.25.1'
623+
'transformers==4.25.1',
624+
# tensorflow transient dep
625+
'absl-py>=0.12.0'
614626
],
615627
'xgboost': ['xgboost>=1.6.0,<2.1.3', 'datatable==1.0.0'],
616628
'tensorflow-hub': ['tensorflow-hub>=0.14.0,<0.16.0'],

0 commit comments

Comments
 (0)