Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include filename in nbdev_export warning when nbdev1 syntax is used #838

Merged
merged 2 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions nbdev/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ def create_modules(path, dest, procs=None, debug=False, mod_maker=ModuleMaker):
all_cells = exp.in_all[mod]
name = getattr(exp, 'default_exp', None) if mod=='#' else mod
if not name:
warn("Could not find `#|default_exp` cell. Note nbdev2 no longer supports nbdev1 syntax. Run `nbdev_migrate` to upgrade.\n"
"See https://nbdev.fast.ai/getting_started.html for more information.")
warn(f"Notebook '{path}' uses `#|export` without `#|default_exp` cell.\n"
"Note nbdev2 no longer supports nbdev1 syntax. Run `nbdev_migrate` to upgrade.\n"
"See https://nbdev.fast.ai/getting_started.html for more information.")
return
mm = mod_maker(dest=dest, name=name, nb_path=path, is_new=mod=='#')
mm.make(cells, all_cells, lib_path=dest)
Expand Down
5 changes: 3 additions & 2 deletions nbs/04a_export.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@
" all_cells = exp.in_all[mod]\n",
" name = getattr(exp, 'default_exp', None) if mod=='#' else mod\n",
" if not name:\n",
" warn(\"Could not find `#|default_exp` cell. Note nbdev2 no longer supports nbdev1 syntax. Run `nbdev_migrate` to upgrade.\\n\"\n",
" \"See https://nbdev.fast.ai/getting_started.html for more information.\")\n",
" warn(f\"Notebook '{path}' uses `#|export` without `#|default_exp` cell.\\n\"\n",
" \"Note nbdev2 no longer supports nbdev1 syntax. Run `nbdev_migrate` to upgrade.\\n\"\n",
" \"See https://nbdev.fast.ai/getting_started.html for more information.\")\n",
" return\n",
" mm = mod_maker(dest=dest, name=name, nb_path=path, is_new=mod=='#')\n",
" mm.make(cells, all_cells, lib_path=dest)"
Expand Down