Skip to content

Commit 6d2ba1b

Browse files
committed
Try adding path modification as first notebook cell
1 parent 0c07e40 commit 6d2ba1b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/source/conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
import sys
2323
import warnings
2424
from datetime import datetime
25+
from pathlib import Path
2526

2627
sys.path.insert(0, os.path.abspath("."))
28+
TEST_DIR = str(Path('..', '..', 'test').resolve())
2729

2830

2931
import pytorch_sphinx_theme
@@ -157,9 +159,12 @@ def reset_mpl(gallery_conf, fname):
157159
**_get_pattern(),
158160
"backreferences_dir": "gen_modules/backreferences",
159161
"promote_jupyter_magic": True,
160-
"first_notebook_cell": None,
161162
"doc_module": ("torchaudio",),
162163
"reset_modules": (reset_mpl, "seaborn"),
164+
'first_notebook_cell': (
165+
"import sys\n"
166+
f"sys.path.insert(0, {TEST_DIR})"
167+
)
163168
}
164169
autosummary_generate = True
165170

0 commit comments

Comments
 (0)