Skip to content

Commit 4125c47

Browse files
committed
Merge branch 'master' of github.com:fastai/nbdev
2 parents 0916786 + fdd8af7 commit 4125c47

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

nbdev/cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ def refresh_quarto_yml():
269269
cfg = get_config()
270270
p = cfg.path('nbs_path')/'_quarto.yml'
271271
vals = {k:cfg.get(k) for k in ['doc_path', 'title', 'description', 'branch', 'git_url', 'doc_host', 'doc_baseurl']}
272+
# Do not build _quarto_yml if custom_quarto_yml is set to True
273+
if str2bool(config_key('custom_quarto_yml', default="False", path=False)): return
272274
if 'title' not in vals: vals['title'] = vals['lib_name']
273275
yml=_quarto_yml.format(**vals)
274276
p.write_text(yml)

nbdev/doclinks.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,11 @@ def build_modidx():
112112
if os.environ.get('IN_TEST',0): return
113113
_fn = dest/'_modidx.py'
114114
nbs_path = config_key('nbs_path')
115-
files = globtastic(nbs_path)
116115
with contextlib.suppress(FileNotFoundError): _fn.unlink()
117116
cfg = get_config()
118117
doc_func = partial(_doc_link, urljoin(cfg.doc_host,cfg.doc_baseurl))
119-
for file in dest.glob("**/*.py"):
120-
if file.name[0]!='_': DocLinks(file, doc_func, _fn).build_index()
118+
for file in globtastic(dest, file_glob="*.py", skip_folder_re="\.ipynb_checkpoints"):
119+
if Path(file).name[0]!='_': DocLinks(file, doc_func, _fn).build_index()
121120

122121
# %% ../nbs/04b_doclinks.ipynb 28
123122
@delegates(globtastic, but=['file_glob', 'skip_folder_re'])

nbdev/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def nbdev_test(
9999
else:
100100
_fence = '='*50
101101
failed = '\n\t'.join(f.name for p,f in zip(passed,files) if not p)
102-
sys.stderr.write(f"\nnbdev Tests Failed On The Following Notebooks:\n{_fence}\n\t{failed}")
102+
sys.stderr.write(f"\nnbdev Tests Failed On The Following Notebooks:\n{_fence}\n\t{failed}\n")
103103
exit(1)
104104
if timing:
105105
for i,t in sorted(enumerate(times), key=lambda o:o[1], reverse=True): print(f"{files[i].name}: {int(t)} secs")

nbs/04b_doclinks.ipynb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,12 +396,11 @@
396396
" if os.environ.get('IN_TEST',0): return\n",
397397
" _fn = dest/'_modidx.py'\n",
398398
" nbs_path = config_key('nbs_path')\n",
399-
" files = globtastic(nbs_path)\n",
400399
" with contextlib.suppress(FileNotFoundError): _fn.unlink()\n",
401400
" cfg = get_config()\n",
402401
" doc_func = partial(_doc_link, urljoin(cfg.doc_host,cfg.doc_baseurl))\n",
403-
" for file in dest.glob(\"**/*.py\"):\n",
404-
" if file.name[0]!='_': DocLinks(file, doc_func, _fn).build_index()"
402+
" for file in globtastic(dest, file_glob=\"*.py\", skip_folder_re=\"\\.ipynb_checkpoints\"):\n",
403+
" if Path(file).name[0]!='_': DocLinks(file, doc_func, _fn).build_index()"
405404
]
406405
},
407406
{

nbs/10_cli.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,8 @@
468468
" cfg = get_config()\n",
469469
" p = cfg.path('nbs_path')/'_quarto.yml'\n",
470470
" vals = {k:cfg.get(k) for k in ['doc_path', 'title', 'description', 'branch', 'git_url', 'doc_host', 'doc_baseurl']}\n",
471+
" # Do not build _quarto_yml if custom_quarto_yml is set to True\n",
472+
" if str2bool(config_key('custom_quarto_yml', default=\"False\", path=False)): return\n",
471473
" if 'title' not in vals: vals['title'] = vals['lib_name']\n",
472474
" yml=_quarto_yml.format(**vals)\n",
473475
" p.write_text(yml)"
@@ -660,7 +662,7 @@
660662
],
661663
"metadata": {
662664
"kernelspec": {
663-
"display_name": "Python 3 (ipykernel)",
665+
"display_name": "Python 3.8.12 ('.venv': venv)",
664666
"language": "python",
665667
"name": "python3"
666668
}

nbs/14_test.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
" else: \n",
207207
" _fence = '='*50\n",
208208
" failed = '\\n\\t'.join(f.name for p,f in zip(passed,files) if not p)\n",
209-
" sys.stderr.write(f\"\\nnbdev Tests Failed On The Following Notebooks:\\n{_fence}\\n\\t{failed}\")\n",
209+
" sys.stderr.write(f\"\\nnbdev Tests Failed On The Following Notebooks:\\n{_fence}\\n\\t{failed}\\n\")\n",
210210
" exit(1)\n",
211211
" if timing:\n",
212212
" for i,t in sorted(enumerate(times), key=lambda o:o[1], reverse=True): print(f\"{files[i].name}: {int(t)} secs\")"

0 commit comments

Comments
 (0)