Skip to content

Commit c22d6e6

Browse files
committed
Use constraint file for py310 ml and py311 ml to fix dependency resolution
1 parent d5d687d commit c22d6e6

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

sdks/python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ def get_portability_package_data():
542542
# tensorflow-transform requires dill, but doesn't set dill as a
543543
# hard requirement in setup.py.
544544
'dill',
545-
'tensorflow-transform>=1.14.0,<1.16.0',
545+
'tensorflow-transform',
546546
# Comment out xgboost as it is breaking presubmit python ml
547547
# tests due to tag check introduced since pip 24.2
548548
# https://github.com/apache/beam/issues/31285

sdks/python/tox.ini

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,22 +103,27 @@ commands =
103103
python apache_beam/examples/complete/autocomplete_test.py
104104
bash {toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
105105

106-
[testenv:py{310,311}-ml]
106+
[testenv:py310-ml]
107107
# Don't set TMPDIR to avoid "AF_UNIX path too long" errors in certain tests.
108+
install_command =
109+
{envbindir}/python {envbindir}/pip install --retries 10 --constraint {toxinidir}/container/ml/py310/base_image_requirements.txt {opts} {packages}
110+
deps =
111+
pip==25.0.1
112+
pip_pre = False
113+
extras = test,gcp,dataframe,ml_test
114+
commands =
115+
/bin/sh -c "pip freeze | grep -E tensorflow"
116+
bash {toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
117+
118+
[testenv:py311-ml]
119+
# Don't set TMPDIR to avoid "AF_UNIX path too long" errors in certain tests.
120+
install_command =
121+
{envbindir}/python {envbindir}/pip install --retries 10 --constraint {toxinidir}/container/ml/py311/base_image_requirements.txt {opts} {packages}
108122
deps =
109123
pip==25.0.1
110-
accelerate>=1.6.0
111-
onnx<1.19.0
112-
google-cloud-aiplatform==1.138.0
113-
googleapis-common-protos==1.72.0
114-
grpcio==1.65.5
115-
grpcio-status==1.65.5
116-
tensorflow>=2.12,<2.17
117124
pip_pre = False
118-
setenv =
119125
extras = test,gcp,dataframe,ml_test
120126
commands =
121-
# Log tensorflow version for debugging
122127
/bin/sh -c "pip freeze | grep -E tensorflow"
123128
bash {toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
124129

0 commit comments

Comments
 (0)