Skip to content

Commit 60432e1

Browse files
fineguyThe TensorFlow Datasets Authors
authored andcommitted
Fix Notebook tests.
PiperOrigin-RevId: 621553263
1 parent 5ca6045 commit 60432e1

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

.github/actions/setup/action.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ inputs:
1414
description: 'Extra dependencies'
1515
required: false
1616
default: 'tests-all'
17+
use-cache:
18+
description: 'Use cache'
19+
required: false
20+
default: 'true'
1721

1822
runs:
1923
using: 'composite'
@@ -51,13 +55,18 @@ runs:
5155
- name: Store inputs for identifying Python cache
5256
run: echo "${{ env.today }}-${{ inputs.extras }}" >> python-cache-keys.txt
5357
shell: bash
54-
- uses: actions/setup-python@v5
58+
- if: ${{ inputs.use-cache == 'true' }}
59+
uses: actions/setup-python@v5
5560
with:
5661
python-version: ${{ inputs.python-version }}
5762
cache: 'pip'
5863
cache-dependency-path: |
5964
setup.py
6065
python-cache-keys.txt
66+
- if: ${{ inputs.use-cache == 'false' }}
67+
uses: actions/setup-python@v5
68+
with:
69+
python-version: ${{ inputs.python-version }}
6170

6271
# Install Python deps.
6372
# If Python cache is restored then we don't need to install dependencies again.

.github/workflows/pytest.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ jobs:
185185
- uses: ./.github/actions/setup
186186
with:
187187
tf-version: tensorflow
188-
189-
- run: pip install ipython
188+
use-cache: false
190189

191190
# Test each notebook sequentially.
192191
- name: Run notebook
@@ -202,6 +201,7 @@ jobs:
202201
--ExecutePreprocessor.timeout=600 \
203202
--ExecutePreprocessor.kernel_name=tfds-notebook \
204203
--to notebook \
205-
--execute $notebook
204+
--execute $notebook && \
205+
pip install tensorflow # reinstall tensorflow if it was uninstalled
206206
fi
207207
done

docs/data_source.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@
4747
" <a target=\"_blank\" href=\"https://www.tensorflow.org/datasets/tfless_tfds\"><img src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" />View on TensorFlow.org</a>\n",
4848
" </td>\n",
4949
" <td>\n",
50-
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/datasets/blob/master/docs/tfless_tfds.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
50+
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/datasets/blob/master/docs/data_source.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
5151
" </td>\n",
5252
" <td>\n",
53-
" <a target=\"_blank\" href=\"https://github.com/tensorflow/datasets/blob/master/docs/tfless_tfds.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
53+
" <a target=\"_blank\" href=\"https://github.com/tensorflow/datasets/blob/master/docs/data_source.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
5454
" </td>\n",
5555
" <td>\n",
56-
" <a href=\"https://storage.googleapis.com/tensorflow_docs/datasets/docs/tfless_tfds.ipynb\"><img src=\"https://www.tensorflow.org/images/download_logo_32px.png\" />Download notebook</a>\n",
56+
" <a href=\"https://storage.googleapis.com/tensorflow_docs/datasets/docs/data_source.ipynb\"><img src=\"https://www.tensorflow.org/images/download_logo_32px.png\" />Download notebook</a>\n",
5757
" </td>\n",
5858
"</table>"
5959
]

0 commit comments

Comments
 (0)