Skip to content

Commit 37c7e28

Browse files
authored
ci(python-deps): update transformers version constraints in tox (apache#36506)
* ci(python-deps): update transformers version constraints and test command Add python version-specific constraints for transformers package to avoid union type syntax issues. Also include transformers version check in test command for debugging purposes. * ci(workflow): increase timeout for python dependency tests The previous timeout of 180 minutes was insufficient for some test runs, so it was doubled to 360 minutes to prevent premature job termination
1 parent 673309b commit 37c7e28

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"comment": "Modify this file in a trivial way to cause this test suite to run",
3-
"modification": 2
3+
"modification": 3
44
}

.github/workflows/beam_PostCommit_Python_Dependency.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
job_name: ['beam_PostCommit_Python_Dependency']
6161
job_phrase: ['Run Python PostCommit Dependency']
6262
python_version: ['3.9','3.13']
63-
timeout-minutes: 180
63+
timeout-minutes: 360
6464
if: |
6565
github.event_name == 'workflow_dispatch' ||
6666
github.event_name == 'pull_request_target' ||

sdks/python/tox.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,12 +557,16 @@ commands =
557557
deps =
558558
sentence-transformers==3.3.1
559559
accelerate>=1.6.0
560+
# Use Python version-specific transformers constraints to avoid union type syntax issues
561+
transformers>=4.28.0,<4.55.0; python_version < "3.10"
562+
transformers>=4.28.0,<4.56.0; python_version >= "3.10"
560563
passenv = HF_INFERENCE_TOKEN
561564
extras = test,gcp
562565
commands =
563566
# Log aiplatform and its dependencies version for debugging
564567
/bin/sh -c "pip freeze | grep -E sentence-transformers"
565568
/bin/sh -c "pip freeze | grep -E google-cloud-aiplatform"
569+
/bin/sh -c "pip freeze | grep -E transformers"
566570
# Allow exit code 5 (no tests run) so that we can run this command safely on arbitrary subdirectories.
567571
/bin/sh -c 'pytest apache_beam/ml/transforms/embeddings -o junit_suite_name={envname} --junitxml=pytest_{envname}.xml -n 6 {posargs}; ret=$?; [ $ret = 5 ] && exit 0 || exit $ret'
568572

0 commit comments

Comments
 (0)