Repository navigation
Transition OSS Python dependencies and CI builds to hermetic Python. - #1566
Open
copybara-service[bot] wants to merge 1 commit into
Open
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
test_997953043
branch
14 times, most recently
from
October 14, 2026 17:11
4a19544 to
bef9fbd
Compare
Open-source builds and CI pipelines previously relied on legacy `@pypi_<pkg>//:pkg` repository targets, `@release_or_nightly` workspace rules, and host-installed Python packages (`pip install`) before invoking Bazel. With the migration to `rules_python` hermetic Python toolchains, Bazel resolves Python interpreter versions and wheel dependencies directly via `requirements.txt` lockfiles and `@pypi//<pkg>:pkg` targets, making host-level package installation and legacy workspace dependencies redundant and error-prone. Migrate OSS Python dependency rewrites and `oss_scripts/pip_package/BUILD` targets to `@pypi//<pkg>:pkg`, remove the obsolete `extra_py_deps` helper and `@org_tensorflow_datasets` workspace archive, and declare explicit test dependencies in `BUILD` targets. Update `oss_scripts/configure.sh` and `py_deps_profile.bzl` to persist `HERMETIC_PYTHON_VERSION`, `IS_NIGHTLY`, and `TF_VERSION` into `.bazelrc`, re-evaluate the repository rule when environment variables change, and pin `tensorflow==<TF_VERSION>` (including `--pre` support for release candidates) when re-locking requirements, while simplifying presubmit, release, and Docker scripts to pass `HERMETIC_PYTHON_VERSION` instead of managing host virtual environments. Additionally, tag benchmark targets with `benchmark-test` and filter them out during `bazel test` so Python 3.12+ test runners do not fail on empty `TestCase` suites, ensure `rules_ml_toolchain` overrides `tf_workspace0()` in the same `WORKSPACE` evaluation chunk, and read only the first line of `.bazelversion` in `run_tests.sh`. PiperOrigin-RevId: 997953043
copybara-service
Bot
force-pushed
the
test_997953043
branch
from
October 15, 2026 19:48
bef9fbd to
7cb4917
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Transition OSS Python dependencies and CI builds to hermetic Python.
Open-source builds and CI pipelines previously relied on legacy
@pypi_<pkg>//:pkgrepository targets,@release_or_nightlyworkspace rules, and host-installed Python packages (pip install) before invoking Bazel. With the migration torules_pythonhermetic Python toolchains, Bazel resolves Python interpreter versions and wheel dependencies directly viarequirements.txtlockfiles and@pypi//<pkg>:pkgtargets, making host-level package installation and legacy workspace dependencies redundant and error-prone.Migrate OSS Python dependency rewrites and
oss_scripts/pip_package/BUILDtargets to@pypi//<pkg>:pkg, remove the obsoleteextra_py_depshelper and@org_tensorflow_datasetsworkspace archive, and declare explicit test dependencies inBUILDtargets. Updateoss_scripts/configure.shandpy_deps_profile.bzlto persistHERMETIC_PYTHON_VERSION,IS_NIGHTLY, andTF_VERSIONinto.bazelrc, re-evaluate the repository rule when environment variables change, and pintensorflow==<TF_VERSION>(including--presupport for release candidates) when re-locking requirements, while simplifying presubmit, release, and Docker scripts to passHERMETIC_PYTHON_VERSIONinstead of managing host virtual environments. Additionally, tag benchmark targets withbenchmark-testand filter them out duringbazel testso Python 3.12+ test runners do not fail on emptyTestCasesuites, ensurerules_ml_toolchainoverridestf_workspace0()in the sameWORKSPACEevaluation chunk, and read only the first line of.bazelversioninrun_tests.sh.