Skip to content

Conversation

@psamanoelton
Copy link

Summary

  • Enable building TFQ against TensorFlow 2.16.2 with Bazel 6.5.x
  • Keep Keras 2 (“tf-keras”) path via TF_USE_LEGACY_KERAS=1 to avoid Keras 3 breakages
  • Allow selecting system/venv/conda Python; wire that interpreter through Bazel
  • Make wheel-build script honor chosen Python and include setuptools

Key changes

  • WORKSPACE: bump @org_tensorflow to 2.16.2, add a tiny @python local_repository shim
  • third_party/python_legacy/defs.bzl: export interpreter as a string (what TF’s local_config_python expects)
  • configure.sh: --python= flag; generate .tf_configure.bazelrc + .bazelrc + the python shim
  • .bazelrc: ensure TF_USE_LEGACY_KERAS=1 for build/test; keep existing warnings/rpath tweaks
  • release/build_pip_package.sh: invoke ${PYTHON_BIN_PATH:-python3} and ensure setuptools present
  • setup.py: (optionally) relax deps to run on TF 2.16 (sympy==1.14); extras pin tensorflow==2.16.0

Testing

  • Linux/Ubuntu 22.04 (Docker), Python 3.11, Bazelisk → Bazel 6.5.0
  • bazel build ... release:build_pip_package succeeds
  • Unit tests (scripts/test_all.sh) pass with
  • Wheel installs and imports with TF 2.16.2 + tf-keras 2.16.0, Cirq 1.3.0, NumPy 1.26.4

Notes

  • This keeps TFQ on Keras 2 path; Keras 3 migration can be handled in a a future PR.
  • This changes will help on the incoming upgrades to 2.20.

@mhucka mhucka self-assigned this Nov 11, 2025
@mhucka mhucka added area/dependencies Involves libraries or other software that TFQ depends on area/health Involves general matters of project configuration, health, maintenance, and similar concerns area/installation Involves installation of TFQ area/tensorflow Involves TensorFlow labels Nov 11, 2025
Copy link
Member

@mhucka mhucka left a comment

Choose a reason for hiding this comment

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

Thank you for the work, and I'm sorry about the number of changes requested here …

psamanoelton and others added 9 commits November 18, 2025 11:07
Co-authored-by: Michael Hucka <mhucka@google.com>
Co-authored-by: Michael Hucka <mhucka@google.com>
Co-authored-by: Michael Hucka <mhucka@google.com>
Co-authored-by: Michael Hucka <mhucka@google.com>
Co-authored-by: Michael Hucka <mhucka@google.com>
Co-authored-by: Michael Hucka <mhucka@google.com>
Co-authored-by: Michael Hucka <mhucka@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dependencies Involves libraries or other software that TFQ depends on area/health Involves general matters of project configuration, health, maintenance, and similar concerns area/installation Involves installation of TFQ area/tensorflow Involves TensorFlow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants