@@ -125,15 +125,23 @@ smoke() {
125125 smoke_tf=" $2 "
126126 set +x
127127 printf ' \n\n%70s\n' | tr ' ' ' ='
128- echo " Smoke testing with ${smoke_python} and ${smoke_tf} ..."
128+ if [ -z " ${smoke_tf} " ]; then
129+ echo " Smoke testing with ${smoke_python} and no tensorflow..."
130+ export TENSORBOARD_NO_TF=1
131+ else
132+ echo " Smoke testing with ${smoke_python} and ${smoke_tf} ..."
133+ fi
129134 printf ' \n'
130135 set -x
131136 command -v " ${smoke_python} " > /dev/null
132137 virtualenv -qp " ${smoke_python} " " ${smoke_venv} "
133138 cd " ${smoke_venv} "
134139 . bin/activate
135140 pip install -qU pip
136- pip install -qU " ${smoke_tf} "
141+
142+ if [ -n " ${smoke_tf} " ]; then
143+ pip install -qU " ${smoke_tf} "
144+ fi
137145 pip install -qU ../dist/* " py${py_major_version} " * .whl > /dev/null
138146 pip freeze # Log the results of pip installation
139147
@@ -153,32 +161,40 @@ smoke() {
153161 python -c "
154162import tensorboard as tb
155163assert tb.__version__ == tb.version.VERSION
156- tb.summary.scalar_pb('test', 42)
157164from tensorboard.plugins.projector import visualize_embeddings
158- from tensorboard.plugins.beholder import Beholder, BeholderHook
159165tb.notebook.start # don't invoke; just check existence
160166"
167+ if [ -n " ${smoke_tf} " ]; then
168+ # Only test summary scalar and beholder with TF
169+ python -c "
170+ import tensorboard as tb
171+ tb.summary.scalar_pb('test', 42)
172+ from tensorboard.plugins.beholder import Beholder, BeholderHook
173+ "
174+ fi
161175
162- # Exhaustively test various sequences of importing tf.summary.
163- test_tf_summary () {
164- # First argument is subpath to test, e.g. '' or '.compat.v2'.
165- import_attr=" import tensorflow as tf; a = tf${1} .summary; a.write; a.scalar"
166- import_as=" import tensorflow${1} .summary as b; b.write; b.scalar"
167- import_from=" from tensorflow${1} import summary as c; c.write; c.scalar"
168- printf ' %s\n' " ${import_attr} " " ${import_as} " " ${import_from} " | python -
169- printf ' %s\n' " ${import_attr} " " ${import_from} " " ${import_as} " | python -
170- printf ' %s\n' " ${import_as} " " ${import_attr} " " ${import_from} " | python -
171- printf ' %s\n' " ${import_as} " " ${import_from} " " ${import_attr} " | python -
172- printf ' %s\n' " ${import_from} " " ${import_attr} " " ${import_as} " | python -
173- printf ' %s\n' " ${import_from} " " ${import_as} " " ${import_attr} " | python -
174- }
175- test_tf_summary ' .compat.v2'
176- is_tf_2 () {
177- python -c " import tensorflow as tf; assert tf.__version__[:2] == '2.'" \
178- > /dev/null 2>&1
179- }
180- if is_tf_2 ; then
181- test_tf_summary ' '
176+ if [ -n " ${smoke_tf} " ]; then
177+ # Exhaustively test various sequences of importing tf.summary.
178+ test_tf_summary () {
179+ # First argument is subpath to test, e.g. '' or '.compat.v2'.
180+ import_attr=" import tensorflow as tf; a = tf${1} .summary; a.write; a.scalar"
181+ import_as=" import tensorflow${1} .summary as b; b.write; b.scalar"
182+ import_from=" from tensorflow${1} import summary as c; c.write; c.scalar"
183+ printf ' %s\n' " ${import_attr} " " ${import_as} " " ${import_from} " | python -
184+ printf ' %s\n' " ${import_attr} " " ${import_from} " " ${import_as} " | python -
185+ printf ' %s\n' " ${import_as} " " ${import_attr} " " ${import_from} " | python -
186+ printf ' %s\n' " ${import_as} " " ${import_from} " " ${import_attr} " | python -
187+ printf ' %s\n' " ${import_from} " " ${import_attr} " " ${import_as} " | python -
188+ printf ' %s\n' " ${import_from} " " ${import_as} " " ${import_attr} " | python -
189+ }
190+ test_tf_summary ' .compat.v2'
191+ is_tf_2 () {
192+ python -c " import tensorflow as tf; assert tf.__version__[:2] == '2.'" \
193+ > /dev/null 2>&1
194+ }
195+ if is_tf_2 ; then
196+ test_tf_summary ' '
197+ fi
182198 fi
183199
184200 deactivate
0 commit comments