File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,15 +90,22 @@ def run(self):
9090 bazel_version = f .read ().strip ()
9191 os .environ ["USE_BAZEL_VERSION" ] = bazel_version
9292
93+ pythonpath = os .environ .get ("PYTHONPATH" , "" )
94+ # Include sys.path entries to support PEP 517 isolated build environments
95+ sys_path_entries = os .pathsep .join ([p for p in sys .path if p ])
96+ if pythonpath :
97+ pythonpath = os .pathsep .join ([pythonpath , sys_path_entries ])
98+ else :
99+ pythonpath = sys_path_entries
100+
93101 bazel_args = [
94102 self ._bazel_cmd ,
95103 "run" ,
96104 "-c" ,
97105 "opt" ,
98106 f"--repo_env=PYTHON_BIN_PATH={ sys .executable } " ,
107+ f"--repo_env=PYTHONPATH={ pythonpath } " ,
99108 ]
100- if "PYTHONPATH" in os .environ :
101- bazel_args .append (f"--repo_env=PYTHONPATH={ os .environ ['PYTHONPATH' ]} " )
102109
103110 bazel_args .extend (self ._additional_build_options )
104111 bazel_args .append ("//tensorflow_data_validation:move_generated_files" )
You can’t perform that action at this time.
0 commit comments