Skip to content

[Python] Restore legacy TensorFlow dependency tests - #40771

Open
bvolpato wants to merge 1 commit into
apache:masterfrom
bvolpato:bvolpato/legacy-tensorflow-iam-constraints
Open

bvolpato wants to merge 1 commit into
apache:masterfrom
bvolpato:bvolpato/legacy-tensorflow-iam-constraints

Conversation

@bvolpato

Copy link
Copy Markdown
Contributor

Related #30799.

The legacy TensorFlow environments install the GCP extra and then force protobuf back to 4.25.5. Current GCP dependencies require protobuf 6, so that leaves an inconsistent environment and causes import failures during test collection.

Keep these compatibility environments on the test extra and constrain later package installation to the resolved TensorFlow dependencies. Install TensorFlow Hub explicitly so the inference tests run rather than skipping the module. Cloud coverage remains in the cloud environments.

Validated dependency resolution, pip check, full test collection, and the TensorFlow inference suite for both environments with tox's dependency-only packaging mode. This exercises the source checkout without rebuilding the native SDK wheel. The environments can be run with tox -e py311-tensorflow-212,py312-tensorflow-216.

@github-actions github-actions Bot added python size/s S: 10-49 lines changed labels Oct 25, 2026
@bvolpato
bvolpato marked this pull request as ready for review October 25, 2026 05:36

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 Review Summary

This PR resolves dependency conflicts in the legacy py311-tensorflow-212 and py312-tensorflow-216 tox environments by replacing the gcp extra with test only, constraining package dependencies during SDK installation (constrain_package_deps and use_frozen_constraints), and pinning protobuf==4.25.5, setuptools<82, and tensorflow-hub directly in deps.

🔍 General Feedback

  • Moving protobuf==4.25.5 from commands_pre into deps combined with constrain_package_deps = True and use_frozen_constraints = True is a much cleaner approach that ensures pip check passes during environment setup.
  • Explicitly adding tensorflow-hub and setuptools<82 (for pkg_resources compatibility) aligns well with the other ML test environments in tox.ini and ensures the TensorFlow inference test suite is actually executed rather than skipped.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.90%. Comparing base (a8d6afd) to head (d914809).
⚠️ Report is 74 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #40771      +/-   ##
==========================================
- Coverage   80.04%   79.90%   -0.15%     
==========================================
  Files         490      493       +3     
  Lines       82916    83473     +557     
==========================================
+ Hits        66373    66700     +327     
- Misses      16543    16773     +230     
Flag Coverage Δ
python 79.90% <ø> (-0.15%) ⬇️

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.

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @shunping for label python.
Backup reviewer: damccorm (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant