Skip to content

[Python] Update Direct inferencePostCommitIT requirements and Gradle tasks for Python 3.13 - #41643

Closed
damccorm wants to merge 1 commit into
apache:masterfrom
damccorm:fix/direct-ml-it-requirements-and-gradle-config
Closed

damccorm wants to merge 1 commit into
apache:masterfrom
damccorm:fix/direct-ml-it-requirements-and-gradle-config

Conversation

@damccorm

Copy link
Copy Markdown
Contributor

Updates Direct inferencePostCommitIT dependency constraints and Gradle task configs for Python 3.13:

  • tensorflow_tests_requirements.txt: Use Python-version markers (tf-keras>=2.16.0 + tensorflow>=2.16.0,<2.22 on Python >= 3.12, preserving keras<3.0.0 + tensorflow>=2.12.0,<2.16 on Python < 3.12 for the Python 3.11 Dataflow cost benchmarks).
  • torch_tests_requirements.txt & huggingface_tests_requirements.txt: Cap torch>=2.3.0,<2.12.0 (matching setup.py and tox.ini) so torch>=2.12 does not pull triton>=3.7, which aborts with an LLVM option registration collision when imported alongside TensorFlow in the shared virtualenv; add tensorflow>=2.12.0,<2.22 and tf-keras>=2.16.0; python_version >= '3.12' to huggingface_tests_requirements.txt.
  • sdks/python/test-suites/direct/common.gradle:
    • Remove the obsolete pip install 'scikit-learn<1.2.0' doFirst step in sklearnInferenceTest (fails to build on Python 3.13; apache-beam[test] already provides scikit-learn<1.8.0).
    • Export TF_USE_LEGACY_KERAS=1 in tensorflowInferenceTest so legacy TF2 SavedModels load under TensorFlow 2.16+.
    • Install enrichment_tests_requirements.txt (redis>=5.0.0,<6) in testcontainersTest (matching dataflow:mockAPITests, needed since redis was moved to an optional extra in split redis into extra #36772).
    • Give each direct inference/enrichment Gradle task a distinct JUnit suite name so per-task XML reports no longer overwrite pytest_postCommitIT-direct-py*.xml.

Verification

Part of the stack leading up to re-enabling Python 3.13 inferencePostCommitIT in #41595 (independent of the other prerequisite PRs; can be merged in any order).

…tasks for Python 3.13

- tensorflow_tests_requirements.txt: use Python-version markers for tf-keras
  and tensorflow>=2.16,<2.22 on Python >= 3.12 while preserving keras<3 and
  tensorflow<2.16 on Python < 3.12.
- torch_tests_requirements.txt & huggingface_tests_requirements.txt: cap
  torch<2.12.0 to prevent triton>=3.7 LLVM option registration collision when
  imported alongside TensorFlow, and add tensorflow/tf-keras bounds for HF ITs.
- sdks/python/test-suites/direct/common.gradle: remove obsolete
  scikit-learn<1.2.0 downgrade, export TF_USE_LEGACY_KERAS=1 for
  tensorflowInferenceTest, install enrichment_tests_requirements.txt (redis) in
  testcontainersTest, and give each direct inference/enrichment task a distinct
  JUnit suite name so per-task XML reports are not overwritten.
@damccorm

Copy link
Copy Markdown
Contributor Author

Replaced by native stacked PR #41648.

@damccorm damccorm closed this Nov 24, 2026
@damccorm
damccorm deleted the fix/direct-ml-it-requirements-and-gradle-config branch November 24, 2026 18:17
@github-actions github-actions Bot added python size/s S: 10-49 lines changed labels Nov 24, 2026
@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.04%. Comparing base (3e230c6) to head (2a67321).

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #41643   +/-   ##
=========================================
  Coverage     58.03%   58.04%           
  Complexity     2844     2844           
=========================================
  Files          1210     1210           
  Lines        173259   173280   +21     
  Branches       2329     2329           
=========================================
+ Hits         100554   100581   +27     
+ Misses        69995    69989    -6     
  Partials       2710     2710           
Flag Coverage Δ
python 80.68% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python size/s S: 10-49 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant