Skip to content

Commit

Permalink
Fix python postcommit dependency workflow (#33740)
Browse files Browse the repository at this point in the history
* fix python postcommit dependencies workflow

* specify numpy version for pythonTest

* add transformers 428,448 tests

* add comment
  • Loading branch information
akashorabek authored Jan 24, 2025
1 parent 88aa3b3 commit 3cb1440
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion sdks/python/apache_beam/dataframe/frames_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ def test_applymap_na_action(self):
# doctest framework
df = pd.DataFrame([[pd.NA, 2.12], [3.356, 4.567]])
self._run_test(
lambda df: df.map(lambda x: len(str(x)), na_action='ignore'),
lambda df: df.applymap(lambda x: len(str(x)), na_action='ignore'),
df,
# TODO: generate proxy using naive type inference on fn
check_proxy=False)
Expand Down
12 changes: 6 additions & 6 deletions sdks/python/test-suites/tox/py39/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ toxTask "testPy39transformers-428", "py39-transformers-428", "${posargs}"
test.dependsOn "testPy39transformers-428"
postCommitPyDep.dependsOn "testPy39transformers-428"

toxTask "testPy39transformers-429", "py39-transformers-429", "${posargs}"
test.dependsOn "testPy39transformers-429"
postCommitPyDep.dependsOn "testPy39transformers-429"
toxTask "testPy39transformers-447", "py39-transformers-447", "${posargs}"
test.dependsOn "testPy39transformers-447"
postCommitPyDep.dependsOn "testPy39transformers-447"

toxTask "testPy39transformers-430", "py39-transformers-430", "${posargs}"
test.dependsOn "testPy39transformers-430"
postCommitPyDep.dependsOn "testPy39transformers-430"
toxTask "testPy39transformers-448", "py39-transformers-448", "${posargs}"
test.dependsOn "testPy39transformers-448"
postCommitPyDep.dependsOn "testPy39transformers-448"

toxTask "testPy39embeddingsMLTransform", "py39-embeddings", "${posargs}"
test.dependsOn "testPy39embeddingsMLTransform"
Expand Down
18 changes: 14 additions & 4 deletions sdks/python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ commands_pre =
pip --version
pip check
bash {toxinidir}/scripts/run_tox_cleanup.sh
deps =
numpy==1.26.4
commands =
python apache_beam/examples/complete/autocomplete_test.py
bash {toxinidir}/scripts/run_pytest.sh {envname} "{posargs}"
Expand Down Expand Up @@ -324,13 +326,15 @@ deps =
3: numpy>=1.14.3,<1.27.0
# Test against versions of pyarrow released in last ~2 years.
9: pyarrow>=9,<10
9: pandas==2.1.4
10: pyarrow>=10,<11
11: pyarrow>=11,<12
12: pyarrow>=12,<13
13: pyarrow>=13,<14
14: pyarrow>=14,<15
15: pyarrow>=15,<16
16: pyarrow>=16,<17
numpy==1.26.4
commands =
# Log pyarrow and numpy version for debugging
/bin/sh -c "pip freeze | grep -E '(pyarrow|numpy)'"
Expand Down Expand Up @@ -371,6 +375,7 @@ deps =
111: torch>=1.11.0,<1.12.0
112: torch>=1.12.0,<1.13.0
113: torch>=1.13.0,<1.14.0
numpy==1.26.4
extras = test,gcp
# Don't set TMPDIR to avoid "AF_UNIX path too long" errors in certain tests.
setenv =
Expand All @@ -386,6 +391,7 @@ deps =
200:
torch>=2.0.0,<2.1.0
mpmath==1.3.0
numpy==1.26.4
extras = test,gcp
# Don't set TMPDIR to avoid "AF_UNIX path too long" errors in certain tests.
setenv =
Expand Down Expand Up @@ -448,12 +454,16 @@ commands =
# Allow exit code 5 (no tests run) so that we can run this command safely on arbitrary subdirectories.
/bin/sh -c 'pytest -o junit_suite_name={envname} --junitxml=pytest_{envname}.xml -n 6 -m uses_xgboost {posargs}; ret=$?; [ $ret = 5 ] && exit 0 || exit $ret'

[testenv:py{39,310}-transformers-{428,429,430}]
[testenv:py{39,310}-transformers-{428,447,448}]
deps =
# sentence-transformers 2.2.2 is the latest version that supports transformers 4.28.x
428: sentence-transformers==2.2.2
428: transformers>=4.28.0,<4.29.0
429: transformers>=4.29.0,<4.30.0
430: transformers>=4.30.0,<4.31.0
torch>=1.9.0,<1.14.0
428: torch>=1.9.0,<1.14.0
447: transformers>=4.47.0,<4.48.0
447: torch>=1.9.0,<1.14.0
448: transformers>=4.48.0,<4.49.0
448: torch>=2.0.0
tensorflow==2.12.0
protobuf==4.25.5
extras = test,gcp,ml_test
Expand Down

0 comments on commit 3cb1440

Please sign in to comment.