nbdev 3.3.5__tar.gz → 3.3.6__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 (40) hide show
  1. {nbdev-3.3.5/nbdev.egg-info → nbdev-3.3.6}/PKG-INFO +2 -2
  2. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/__init__.py +1 -1
  3. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/_modidx.py +2 -4
  4. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/frontmatter.py +7 -30
  5. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/migrate.py +2 -2
  6. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/processors.py +0 -1
  7. {nbdev-3.3.5 → nbdev-3.3.6/nbdev.egg-info}/PKG-INFO +2 -2
  8. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev.egg-info/requires.txt +1 -1
  9. {nbdev-3.3.5 → nbdev-3.3.6}/pyproject.toml +1 -1
  10. {nbdev-3.3.5 → nbdev-3.3.6}/CONTRIBUTING.md +0 -0
  11. {nbdev-3.3.5 → nbdev-3.3.6}/LICENSE +0 -0
  12. {nbdev-3.3.5 → nbdev-3.3.6}/MANIFEST.in +0 -0
  13. {nbdev-3.3.5 → nbdev-3.3.6}/README.md +0 -0
  14. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/clean.py +0 -0
  15. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/cli.py +0 -0
  16. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/config.py +0 -0
  17. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/diff.py +0 -0
  18. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/doclinks.py +0 -0
  19. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/export.py +0 -0
  20. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/extract_attachments.py +0 -0
  21. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/imports.py +0 -0
  22. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/maker.py +0 -0
  23. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/merge.py +0 -0
  24. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/moddocs.py +0 -0
  25. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/process.py +0 -0
  26. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/qmd.py +0 -0
  27. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/quarto.py +0 -0
  28. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/release.py +0 -0
  29. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/scrubmagics.py +0 -0
  30. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/serve.py +0 -0
  31. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/serve_drv.py +0 -0
  32. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/showdoc.py +0 -0
  33. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/skill.py +0 -0
  34. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/sync.py +0 -0
  35. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev/test.py +0 -0
  36. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev.egg-info/SOURCES.txt +0 -0
  37. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev.egg-info/dependency_links.txt +0 -0
  38. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev.egg-info/entry_points.txt +0 -0
  39. {nbdev-3.3.5 → nbdev-3.3.6}/nbdev.egg-info/top_level.txt +0 -0
  40. {nbdev-3.3.5 → nbdev-3.3.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nbdev
3
- Version: 3.3.5
3
+ Version: 3.3.6
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
@@ -16,7 +16,7 @@ Classifier: License :: OSI Approved :: Apache Software License
16
16
  Requires-Python: >=3.10
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
- Requires-Dist: fastcore>=2.1.11
19
+ Requires-Dist: fastcore>=2.2.3
20
20
  Requires-Dist: execnb>=0.2.8
21
21
  Requires-Dist: astunparse
22
22
  Requires-Dist: ghapi>=2.0.2
@@ -6,7 +6,7 @@ Modules:
6
6
  - `nbdev.moddocs`: # Module docs: creating them from existing notebooks
7
7
  - `nbdev.skill`: Author clear, executable nbdev notebooks where code, prose, examples, outputs, and tests form one coherent narrative."""
8
8
 
9
- __version__ = "3.3.5"
9
+ __version__ = "3.3.6"
10
10
 
11
11
  from .doclinks import nbdev_export
12
12
  from .showdoc import show_doc
@@ -141,10 +141,8 @@ d = { 'settings': { 'branch': 'main',
141
141
  'nbdev.frontmatter.FrontmatterProc.end': ( 'api/frontmatter.html#frontmatterproc.end',
142
142
  'nbdev/frontmatter.py'),
143
143
  'nbdev.frontmatter._dict2fm': ('api/frontmatter.html#_dict2fm', 'nbdev/frontmatter.py'),
144
- 'nbdev.frontmatter._fm2dict': ('api/frontmatter.html#_fm2dict', 'nbdev/frontmatter.py'),
145
- 'nbdev.frontmatter._insertfm': ('api/frontmatter.html#_insertfm', 'nbdev/frontmatter.py'),
146
- 'nbdev.frontmatter._md2dict': ('api/frontmatter.html#_md2dict', 'nbdev/frontmatter.py'),
147
- 'nbdev.frontmatter.nb_frontmatter': ('api/frontmatter.html#nb_frontmatter', 'nbdev/frontmatter.py')},
144
+ 'nbdev.frontmatter._fm2dict_md': ('api/frontmatter.html#_fm2dict_md', 'nbdev/frontmatter.py'),
145
+ 'nbdev.frontmatter._insertfm': ('api/frontmatter.html#_insertfm', 'nbdev/frontmatter.py')},
148
146
  'nbdev.imports': {},
149
147
  'nbdev.maker': { 'nbdev.maker.ModuleMaker': ('api/maker.html#modulemaker', 'nbdev/maker.py'),
150
148
  'nbdev.maker.ModuleMaker.__init__': ('api/maker.html#modulemaker.__init__', 'nbdev/maker.py'),
@@ -5,7 +5,7 @@ Docs: https://nbdev.fast.ai/api/frontmatter.html.md"""
5
5
  # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/api/09_frontmatter.ipynb.
6
6
 
7
7
  # %% auto #0
8
- __all__ = ['nb_frontmatter', 'FrontmatterProc']
8
+ __all__ = ['FrontmatterProc']
9
9
 
10
10
  # %% ../nbs/api/09_frontmatter.ipynb #2398f5ef-06d3-4890-8a54-7cf4f81f3894
11
11
  from .imports import *
@@ -21,38 +21,15 @@ _RE_FM_BASE=r'''^---\s*
21
21
  (.*?\S+.*?)
22
22
  ---\s*'''
23
23
 
24
- _re_fm_nb = re.compile(_RE_FM_BASE+'$', flags=re.DOTALL)
25
24
  _re_fm_md = re.compile(_RE_FM_BASE, flags=re.DOTALL)
26
25
 
26
+
27
27
  # %% ../nbs/api/09_frontmatter.ipynb #1725f3b9
28
- def _fm2dict(s:str, nb=True):
29
- "Load YAML frontmatter into a `dict`"
30
- re_fm = _re_fm_nb if nb else _re_fm_md
31
- match = re_fm.search(s.strip())
28
+ def _fm2dict_md(s:str):
29
+ "Load YAML frontmatter opening a markdown file (body allowed) into a `dict`"
30
+ match = _re_fm_md.search(s.strip())
32
31
  return yaml.safe_load(match.group(1)) if match else {}
33
32
 
34
- def _md2dict(s:str):
35
- "Convert H1 formatted markdown cell to frontmatter dict"
36
- if '#' not in s: return {}
37
- m = re.search(r'^#\s+(\S.*?)\s*$', s, flags=re.MULTILINE)
38
- if not m: return {}
39
- res = {'title': m.group(1)}
40
- m = re.search(r'^>\s+(\S.*?)\s*$', s, flags=re.MULTILINE)
41
- if m: res['description'] = m.group(1)
42
- r = re.findall(r'^-\s+(\S.*:.*\S)\s*$', s, flags=re.MULTILINE)
43
- if r:
44
- try: res.update(yaml.safe_load('\n'.join(r)))
45
- except Exception as e: warn(f'Failed to create YAML dict for:\n{r}\n\n{e}\n')
46
- return res
47
-
48
- # %% ../nbs/api/09_frontmatter.ipynb #4ba11b21
49
- def nb_frontmatter(nb):
50
- "Get frontmatter dict from `nb` without modifying cells"
51
- raw = first(c for c in nb.cells if c.cell_type=='raw')
52
- md = first(c for c in nb.cells if c.cell_type=='markdown')
53
- res = _md2dict(md.source) if md else {}
54
- if raw: res.update(_fm2dict(raw.source))
55
- return res
56
33
 
57
34
  # %% ../nbs/api/09_frontmatter.ipynb #1b5d9d32
58
35
  def _dict2fm(d): return f'---\n{yaml.dump(d)}\n---\n\n'
@@ -71,8 +48,8 @@ class FrontmatterProc(Processor):
71
48
  cell.source = None
72
49
 
73
50
  def cell(self, cell):
74
- if cell.cell_type=='raw': self._update(_fm2dict, cell)
75
- elif cell.cell_type=='markdown' and 'title' not in self.fm: self._update(_md2dict, cell)
51
+ if cell.cell_type=='raw': self._update(cell_frontmatter, cell)
52
+ elif cell.cell_type=='markdown' and 'title' not in self.fm: self._update(md_frontmatter, cell)
76
53
 
77
54
  def end(self):
78
55
  self.nb.frontmatter_ = self.fm
@@ -11,7 +11,7 @@ __all__ = ['MigrateProc', 'fp_md_fm', 'migrate_nb', 'migrate_md', 'nbdev_migrate
11
11
  from .process import *
12
12
  from fastcore.nbio import first_code_ln, langs
13
13
  from .frontmatter import *
14
- from .frontmatter import _fm2dict, _re_fm_md, _dict2fm, _insertfm
14
+ from .frontmatter import _fm2dict_md, _re_fm_md, _dict2fm, _insertfm
15
15
  from .processors import *
16
16
  from .config import get_config, read_nb, set_version, pyproject_tmpl, nbdev_defaults
17
17
  from .sync import write_nb
@@ -98,7 +98,7 @@ def fp_md_fm(path):
98
98
  "Make fastpages front matter in markdown files quarto compliant."
99
99
  p = Path(path)
100
100
  md = p.read_text()
101
- fm = _fm2dict(md, nb=False)
101
+ fm = _fm2dict_md(md)
102
102
  if fm:
103
103
  fm = _fp_convert(fm, path)
104
104
  return _re_fm_md.sub(_dict2fm(fm), md)
@@ -18,7 +18,6 @@ from .process import *
18
18
  from .showdoc import *
19
19
  from .doclinks import *
20
20
  from .frontmatter import *
21
- from .frontmatter import _fm2dict
22
21
 
23
22
  from fastcore.nbio import *
24
23
  from execnb.shell import *
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nbdev
3
- Version: 3.3.5
3
+ Version: 3.3.6
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
@@ -16,7 +16,7 @@ Classifier: License :: OSI Approved :: Apache Software License
16
16
  Requires-Python: >=3.10
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
- Requires-Dist: fastcore>=2.1.11
19
+ Requires-Dist: fastcore>=2.2.3
20
20
  Requires-Dist: execnb>=0.2.8
21
21
  Requires-Dist: astunparse
22
22
  Requires-Dist: ghapi>=2.0.2
@@ -1,4 +1,4 @@
1
- fastcore>=2.1.11
1
+ fastcore>=2.2.3
2
2
  execnb>=0.2.8
3
3
  astunparse
4
4
  ghapi>=2.0.2
@@ -19,7 +19,7 @@ classifiers = [
19
19
  "License :: OSI Approved :: Apache Software License",
20
20
  ]
21
21
  dynamic = ["version"]
22
- dependencies = [ "fastcore>=2.1.11", "execnb>=0.2.8", "astunparse", "ghapi>=2.0.2", "watchdog", "asttokens",
22
+ dependencies = [ "fastcore>=2.2.3", "execnb>=0.2.8", "astunparse", "ghapi>=2.0.2", "watchdog", "asttokens",
23
23
  "setuptools", "build", "fastgit>=0.0.7", "pyyaml", "tomli; python_version < '3.11'", ]
24
24
 
25
25
  [project.optional-dependencies]
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
File without changes
File without changes