Testing#279
Open
vkarampudi wants to merge 4 commits into
Open
Conversation
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.
Fix Bazel PEP 517 Build Environment Isolation and Sandbox Restrictions
Problem
When building
tensorflow-data-validationfrom source inside PEP 517 isolated build environments (e.g., standardpip installwithout flags), the installation fails during wheel compilation.Modern Bazel runs repository rules (like
local_python_configure) under a strictly hermetic environment. This process strips out custom environment variables—including the temporaryPYTHONPATHandPYTHON_BIN_PATHcreated bypip's build isolation. As a result:numpy(which was installed in the isolated build environment), raising:ModuleNotFoundError: No module named 'numpy'repository_ctx.execute()does not propagate environmental configurations down to its spawned subprocesses, causing further sandbox resolution failures.Solution
This change propagates the isolated pip build environment dynamically across the Bazel sandbox boundaries:
--repo_env:Updated
setup.pyto dynamically propagatePYTHONPATH(including virtualenv paths fromsys.path) andPYTHON_BIN_PATHinto Bazel commands using--repo_env.Added
PYTHONPATHto the_ENVIRONSlist of thelocal_python_configurerule inthird_party/python_configure.bzlto allow it to cross the repository sandbox boundary.Modified
_raw_execinthird_party/python_configure.bzlto explicitly inheritPYTHONPATH,PYTHON_BIN_PATH, andPYTHON_LIB_PATHfromrepository_ctx.os.environand pass them down via theenvironmentparameter ofrepository_ctx.execute().Impact
Enables seamless out-of-the-box PEP 517 isolated compilation and source wheel builds of
tensorflow-data-validationacross all supported Python versions (including Python 3.13).