nbdev 3.0.15__tar.gz → 3.0.16__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {nbdev-3.0.15/nbdev.egg-info → nbdev-3.0.16}/PKG-INFO +1 -1
  2. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/__init__.py +1 -1
  3. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/export.py +1 -1
  4. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/maker.py +5 -4
  5. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/processors.py +3 -2
  6. {nbdev-3.0.15 → nbdev-3.0.16/nbdev.egg-info}/PKG-INFO +1 -1
  7. {nbdev-3.0.15 → nbdev-3.0.16}/pyproject.toml +1 -1
  8. {nbdev-3.0.15 → nbdev-3.0.16}/CONTRIBUTING.md +0 -0
  9. {nbdev-3.0.15 → nbdev-3.0.16}/LICENSE +0 -0
  10. {nbdev-3.0.15 → nbdev-3.0.16}/MANIFEST.in +0 -0
  11. {nbdev-3.0.15 → nbdev-3.0.16}/README.md +0 -0
  12. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/_modidx.py +0 -0
  13. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/clean.py +0 -0
  14. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/cli.py +0 -0
  15. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/config.py +0 -0
  16. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/diff.py +0 -0
  17. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/doclinks.py +0 -0
  18. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/extract_attachments.py +0 -0
  19. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/frontmatter.py +0 -0
  20. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/imports.py +0 -0
  21. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/merge.py +0 -0
  22. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/migrate.py +0 -0
  23. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/process.py +0 -0
  24. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/qmd.py +0 -0
  25. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/quarto.py +0 -0
  26. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/release.py +0 -0
  27. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/scrubmagics.py +0 -0
  28. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/serve.py +0 -0
  29. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/serve_drv.py +0 -0
  30. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/showdoc.py +0 -0
  31. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/sync.py +0 -0
  32. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev/test.py +0 -0
  33. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev.egg-info/SOURCES.txt +0 -0
  34. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev.egg-info/dependency_links.txt +0 -0
  35. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev.egg-info/entry_points.txt +0 -0
  36. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev.egg-info/requires.txt +0 -0
  37. {nbdev-3.0.15 → nbdev-3.0.16}/nbdev.egg-info/top_level.txt +0 -0
  38. {nbdev-3.0.15 → nbdev-3.0.16}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nbdev
3
- Version: 3.0.15
3
+ Version: 3.0.16
4
4
  Summary: Create delightful software with Jupyter Notebooks
5
5
  Author-email: "Jeremy Howard and the fast.ai community" <j@fast.ai>
6
6
  License: Apache-2.0
@@ -1,4 +1,4 @@
1
- __version__ = "3.0.15"
1
+ __version__ = "3.0.16"
2
2
 
3
3
  from .doclinks import nbdev_export
4
4
  from .showdoc import show_doc
@@ -30,7 +30,7 @@ class ExportModuleProc:
30
30
  def __call__(self, cell):
31
31
  src = cell.source
32
32
  if not src: return
33
- if cell.cell_type=='markdown' and src.startswith('# '): self.modules['#'].append(cell)
33
+ if cell.cell_type=='markdown' and (src.startswith('# ') or 'export' in cell.directives_): self._exporti_(cell)
34
34
  _exports_=_export_
35
35
 
36
36
  # %% ../nbs/api/04_export.ipynb #76717e36
@@ -111,7 +111,7 @@ def make_code_cells(*ss): return dict2nb({'cells':L(ss).map(mk_cell)}).cells
111
111
  # %% ../nbs/api/02_maker.ipynb #a2546836
112
112
  def relative_import(name, fname, level=0):
113
113
  "Convert a module `name` to a name relative to `fname`"
114
- assert not level
114
+ if level: raise ValueError(f"nbdev export does not support relative imports: module={name}, export_path={fname}")
115
115
  sname = name.replace('.','/')
116
116
  if not(os.path.commonpath([sname,fname])): return name
117
117
  rel = os.path.relpath(sname, fname)
@@ -175,14 +175,15 @@ def _import2relative(cells, lib_path=None):
175
175
 
176
176
  # %% ../nbs/api/02_maker.ipynb #5bff9d71
177
177
  def _retr_mdoc(cells):
178
- "Search for md meta quote lines, used to create module docstring"
178
+ "Search for markdown cells used to create module docstring"
179
179
  md1 = first(o for o in cells if o.cell_type=='markdown' and o.source.startswith('# '))
180
180
  if not md1: return ''
181
181
  lines = dropwhile(lambda l: not l.startswith('> '), md1.source.splitlines())
182
182
  lines = list(takewhile(lambda l: l.startswith('> '), lines))
183
- if not lines: return ''
184
183
  summ = '\n'.join(l.lstrip('> ').strip() for l in lines)
185
- return f'"""{summ}"""\n\n' if summ else ''
184
+ docs = L(o.source.rstrip() for o in cells if o.cell_type=='markdown' and 'export' in getattr(o,'directives_',{}))
185
+ mdoc = '\n\n'.join(L(summ)+docs).strip()
186
+ return f'"""{mdoc}"""\n\n' if mdoc else ''
186
187
 
187
188
  # %% ../nbs/api/02_maker.ipynb #cdd205d6
188
189
  @patch
@@ -198,8 +198,9 @@ def rm_header_dash(cell):
198
198
  _hide_dirs = {'export','exporti', 'hide','default_exp'}
199
199
 
200
200
  def rm_export(cell):
201
- "Remove cells that are exported or hidden"
202
- if cell.directives_ and (cell.directives_.keys() & _hide_dirs): del(cell['source'])
201
+ "Remove code cells that are exported or hidden"
202
+ if cell.cell_type=='code' and cell.directives_ and (cell.directives_.keys() & _hide_dirs): del(cell['source'])
203
+
203
204
 
204
205
  # %% ../nbs/api/10_processors.ipynb #2d9a0a30
205
206
  _re_showdoc = re.compile(r'^show_doc', re.MULTILINE)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nbdev
3
- Version: 3.0.15
3
+ Version: 3.0.16
4
4
  Summary: Create delightful software with Jupyter Notebooks
5
5
  Author-email: "Jeremy Howard and the fast.ai community" <j@fast.ai>
6
6
  License: Apache-2.0
@@ -76,7 +76,7 @@ version = {attr = "nbdev.__version__"}
76
76
  include = ["nbdev"]
77
77
 
78
78
  [tool.nbdev]
79
- allowed_metadata_keys = ['solveit_dialog_mode', 'solveit_ver']
79
+ allowed_metadata_keys = ['solveit']
80
80
  custom_sidebar = true
81
81
  readme_nb = "getting_started.ipynb"
82
82
  jupyter_hooks = true
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes