Skip to content

Commit 23ae0f3

Browse files
committed
Update the integrity script to handle Installation.ipynb execution
1 parent d9ae42d commit 23ae0f3

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

scripts/integrity.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
from importlib.util import find_spec
1313

1414
import jsonschema
15+
import nbformat
1516
import pytest
17+
from nbconvert.preprocessors import ExecutePreprocessor
1618

1719
try:
1820
import ruamel.yaml as yaml
@@ -87,9 +89,16 @@ def the_meta_package():
8789

8890
@pytest.fixture(scope="module")
8991
def the_installation_notebook():
90-
""" loads up the installation notebook
92+
""" executes and loads up the installation notebook
9193
"""
92-
return (DOCS / "Installation.ipynb").read_text()
94+
with open(DOCS / "Installation.ipynb") as f:
95+
installation_nb = nbformat.read(f, as_version=4)
96+
executor = ExecutePreprocessor(timeout=600)
97+
98+
# modifies notebook in-place
99+
executor.preprocess(installation_nb, {"metadata": {"path": DOCS}})
100+
101+
return nbformat.writes(installation_nb)
93102

94103

95104
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)