Use temporary file instead of inplace sed while making the virtual pip

This should fix Macos and Linux jobs using an equivalent stanza for both.

PiperOrigin-RevId: 253613917
This commit is contained in:
Mihai Maruseac 2019-06-17 10:52:03 -07:00 committed by TensorFlower Gardener
parent d73778d205
commit 93ebb3fb4a

View File

@ -184,11 +184,11 @@ function prepare_src() {
# _sys.modules[__name__] as the argument of a function -- the last line in
# the deprecation autogenerated pattern)
# TODO(mihaimaruseac): When we move the API to root, remove this hack
# Note: Don't remove space between -i and "": Linux fails if you do as it
# tries to replace in "/_depre..." file, which is wrong.
sed -i"" \
# Note: Can't do in place sed that works on all OS, so use a temp file instead
sed \
"/_deprecation_wrapper$/,/_sys.modules[__name__],/ d" \
"${TMPDIR}/tensorflow_core/__init__.py"
"${TMPDIR}/tensorflow_core/__init__.py" > "${TMPDIR}/tensorflow_core/__init__.out"
mv "${TMPDIR}/tensorflow_core/__init__.out ${TMPDIR}/tensorflow_core/__init__.py"
}
function build_wheel() {