Skip to content

Commit d84033a

Browse files
authored
Merge pull request #1568 from AnswerDotAI/watch_export
Fix `watch-export`
2 parents 15b1623 + 40115fb commit d84033a

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

nbdev/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,16 @@ def watch_export(nbs:str=None, # Nb directory to watch for changes
184184
lib = lib or (cfg.lib_path if cfg else '.')
185185
if cfg and (nbs != cfg.nbs_path or lib != cfg.lib_path) and not force:
186186
raise ValueError("In nbdev project. Use --force to override config.")
187-
run(f'nbdev_export')
187+
run('nbdev-export')
188188
def _export(e,lib=lib):
189189
p = e.src_path
190190
if (not '.ipynb_checkpoints' in p and p.endswith('.ipynb') and not Path(p).name.startswith(('tmp','.~'))):
191191
if e.event_type == 'modified':
192192
time.sleep(0.1)
193-
try: run(f'nb_export --lib_path {lib} "{p}"')
193+
try: run(f'nb-export --lib_path {lib} "{p}"')
194194
except IOError:
195195
time.sleep(0.3)
196-
run(f'nb_export --lib_path {lib} "{p}"')
196+
run(f'nb-export --lib_path {lib} "{p}"')
197197
with fs_watchdog(_export, nbs):
198198
while True: time.sleep(1)
199199

nbs/api/13_cli.ipynb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,16 @@
326326
" lib = lib or (cfg.lib_path if cfg else '.')\n",
327327
" if cfg and (nbs != cfg.nbs_path or lib != cfg.lib_path) and not force:\n",
328328
" raise ValueError(\"In nbdev project. Use --force to override config.\")\n",
329-
" run(f'nbdev_export')\n",
329+
" run('nbdev-export')\n",
330330
" def _export(e,lib=lib):\n",
331331
" p = e.src_path\n",
332332
" if (not '.ipynb_checkpoints' in p and p.endswith('.ipynb') and not Path(p).name.startswith(('tmp','.~'))):\n",
333333
" if e.event_type == 'modified':\n",
334334
" time.sleep(0.1)\n",
335-
" try: run(f'nb_export --lib_path {lib} \"{p}\"')\n",
335+
" try: run(f'nb-export --lib_path {lib} \"{p}\"')\n",
336336
" except IOError:\n",
337337
" time.sleep(0.3)\n",
338-
" run(f'nb_export --lib_path {lib} \"{p}\"')\n",
338+
" run(f'nb-export --lib_path {lib} \"{p}\"')\n",
339339
" with fs_watchdog(_export, nbs):\n",
340340
" while True: time.sleep(1)"
341341
]
@@ -445,7 +445,13 @@
445445
]
446446
}
447447
],
448-
"metadata": {},
448+
"metadata": {
449+
"kernelspec": {
450+
"display_name": "python3",
451+
"language": "python",
452+
"name": "python3"
453+
}
454+
},
449455
"nbformat": 4,
450456
"nbformat_minor": 5
451457
}

nbs/api/16_migrate.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,8 @@
13901390
"outputs": [],
13911391
"source": [
13921392
"from configparser import ConfigParser\n",
1393-
"import tomllib"
1393+
"try: import tomllib\n",
1394+
"except ImportError: import tomli as tomllib"
13941395
]
13951396
},
13961397
{
@@ -1551,7 +1552,10 @@
15511552
]
15521553
}
15531554
],
1554-
"metadata": {},
1555+
"metadata": {
1556+
"solveit_dialog_mode": "learning",
1557+
"solveit_ver": 2
1558+
},
15551559
"nbformat": 4,
15561560
"nbformat_minor": 5
15571561
}

0 commit comments

Comments
 (0)