nbdev 3.3.6__tar.gz → 3.3.8__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.6/nbdev.egg-info → nbdev-3.3.8}/PKG-INFO +3 -3
  2. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/__init__.py +1 -1
  3. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/_modidx.py +1 -0
  4. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/processors.py +3 -1
  5. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/test.py +10 -8
  6. {nbdev-3.3.6 → nbdev-3.3.8/nbdev.egg-info}/PKG-INFO +3 -3
  7. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev.egg-info/requires.txt +2 -2
  8. {nbdev-3.3.6 → nbdev-3.3.8}/pyproject.toml +1 -1
  9. {nbdev-3.3.6 → nbdev-3.3.8}/CONTRIBUTING.md +0 -0
  10. {nbdev-3.3.6 → nbdev-3.3.8}/LICENSE +0 -0
  11. {nbdev-3.3.6 → nbdev-3.3.8}/MANIFEST.in +0 -0
  12. {nbdev-3.3.6 → nbdev-3.3.8}/README.md +0 -0
  13. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/clean.py +0 -0
  14. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/cli.py +0 -0
  15. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/config.py +0 -0
  16. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/diff.py +0 -0
  17. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/doclinks.py +0 -0
  18. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/export.py +0 -0
  19. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/extract_attachments.py +0 -0
  20. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/frontmatter.py +0 -0
  21. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/imports.py +0 -0
  22. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/maker.py +0 -0
  23. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/merge.py +0 -0
  24. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/migrate.py +0 -0
  25. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/moddocs.py +0 -0
  26. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/process.py +0 -0
  27. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/qmd.py +0 -0
  28. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/quarto.py +0 -0
  29. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/release.py +0 -0
  30. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/scrubmagics.py +0 -0
  31. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/serve.py +0 -0
  32. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/serve_drv.py +0 -0
  33. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/showdoc.py +0 -0
  34. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/skill.py +0 -0
  35. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev/sync.py +0 -0
  36. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev.egg-info/SOURCES.txt +0 -0
  37. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev.egg-info/dependency_links.txt +0 -0
  38. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev.egg-info/entry_points.txt +0 -0
  39. {nbdev-3.3.6 → nbdev-3.3.8}/nbdev.egg-info/top_level.txt +0 -0
  40. {nbdev-3.3.6 → nbdev-3.3.8}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nbdev
3
- Version: 3.3.6
3
+ Version: 3.3.8
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,8 +16,8 @@ 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.2.3
20
- Requires-Dist: execnb>=0.2.8
19
+ Requires-Dist: fastcore>=2.2.7
20
+ Requires-Dist: execnb>=0.2.11
21
21
  Requires-Dist: astunparse
22
22
  Requires-Dist: ghapi>=2.0.2
23
23
  Requires-Dist: watchdog
@@ -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.6"
9
+ __version__ = "3.3.8"
10
10
 
11
11
  from .doclinks import nbdev_export
12
12
  from .showdoc import show_doc
@@ -385,5 +385,6 @@ d = { 'settings': { 'branch': 'main',
385
385
  'nbdev.sync.absolute_import': ('api/sync.html#absolute_import', 'nbdev/sync.py'),
386
386
  'nbdev.sync.nbdev_update': ('api/sync.html#nbdev_update', 'nbdev/sync.py')},
387
387
  'nbdev.test': { 'nbdev.test._keep_file': ('api/test.html#_keep_file', 'nbdev/test.py'),
388
+ 'nbdev.test._test_nb_sync': ('api/test.html#_test_nb_sync', 'nbdev/test.py'),
388
389
  'nbdev.test.nbdev_test': ('api/test.html#nbdev_test', 'nbdev/test.py'),
389
390
  'nbdev.test.test_nb': ('api/test.html#test_nb', 'nbdev/test.py')}}}
@@ -12,6 +12,8 @@ __all__ = ['populate_language', 'insert_warning', 'cell_lang', 'add_show_docs',
12
12
  # %% ../nbs/api/10_processors.ipynb #2398f5ef-06d3-4890-8a54-7cf4f81f3894
13
13
  import ast
14
14
 
15
+ from fastcore.aio import run_sync
16
+
15
17
  from .config import *
16
18
  from .imports import *
17
19
  from .process import *
@@ -255,7 +257,7 @@ class exec_show_docs(Processor):
255
257
  if not self.nb.has_docs_ or not hasattr(self, 'k'): return
256
258
  fm = getattr(self.nb, 'frontmatter_', {})
257
259
  if str2bool(fm.get('skip_showdoc', False)): return
258
- if _do_eval(cell): self.k.cell(cell)
260
+ if _do_eval(cell): run_sync(self.k.cell(cell))
259
261
  title = fm.get('title', '')
260
262
  if self.k.exc:
261
263
  raise Exception(f"Error{' in notebook: '+title if title else ''} in cell {cell.idx_} :\n{cell.source}") from self.k.exc
@@ -8,7 +8,7 @@ Docs: https://nbdev.fast.ai/api/test.html.md"""
8
8
  __all__ = ['test_nb', 'nbdev_test']
9
9
 
10
10
  # %% ../nbs/api/12_test.ipynb #45e10c3f
11
- import time,os,sys,traceback,contextlib,inspect,faulthandler,signal
11
+ import time,os,sys,traceback,contextlib,inspect,faulthandler,signal,asyncio
12
12
  from fastcore.basics import *
13
13
  from fastcore.imports import *
14
14
  from fastcore.foundation import *
@@ -25,7 +25,7 @@ from fastcore.nbio import *
25
25
  from execnb.shell import *
26
26
 
27
27
  # %% ../nbs/api/12_test.ipynb #3f4fa1ad
28
- def test_nb(
28
+ async def test_nb(
29
29
  fn, # file name of notebook to test
30
30
  skip_flags=None, # list of flags marking cells to skip
31
31
  force_flags=None, # list of flags marking cells to always run
@@ -48,12 +48,11 @@ def test_nb(
48
48
  fm = nb_frontmatter(nb)
49
49
  if str2bool(fm.get('skip_exec', False)) or nb_lang(nb) != 'python': return True, 0
50
50
 
51
+ dflt = fm_default_eval(fm)
51
52
  def _no_eval(cell):
52
53
  if cell.cell_type != 'code': return True
53
- if 'nbdev_export'+'(' in cell.source: return True
54
- direc = getattr(cell, 'directives_', {}) or {}
55
- if direc.get('eval', '').lower() == 'false': return True
56
- return flags & direc.keys()
54
+ if not does_cell_eval(cell, dflt): return True
55
+ return flags & (getattr(cell, 'directives_', {}) or {}).keys()
57
56
 
58
57
  start = time.time()
59
58
  if profile is None: profile = bool(get_config(fn.parent).exec_profile)
@@ -61,7 +60,7 @@ def test_nb(
61
60
  if do_print: print(f'Starting {fn}')
62
61
  try:
63
62
  with working_directory(fn.parent):
64
- k.run_all(nb, exc_stop=True, preproc=_no_eval, verbose=verbose)
63
+ await k.run_all(nb, exc_stop=True, preproc=_no_eval, verbose=verbose)
65
64
  if save: write_nb(nb, fn)
66
65
  res = True
67
66
  except:
@@ -74,6 +73,9 @@ def test_nb(
74
73
  else: os.environ['IN_TEST'] = prev_test
75
74
 
76
75
 
76
+ # %% ../nbs/api/12_test.ipynb #12516e0a
77
+ def _test_nb_sync(fn, **kwargs): return asyncio.run(test_nb(fn, **kwargs))
78
+
77
79
  # %% ../nbs/api/12_test.ipynb #d8bf1f1b-935d-4b69-ba96-827c5d7213f0
78
80
  def _keep_file(
79
81
  p:Path, # filename for which to check for `indicator_fname`
@@ -112,7 +114,7 @@ def nbdev_test(
112
114
  else: kw = {'method':'spawn'} if sys.platform=='darwin' else {}
113
115
  wd_pth = cfg.nbs_path
114
116
  with working_directory(wd_pth if (wd_pth and wd_pth.exists()) else os.getcwd()):
115
- results = parallel(test_nb, files, skip_flags=skip_flags, force_flags=force_flags, n_workers=n_workers,
117
+ results = parallel(_test_nb_sync, files, skip_flags=skip_flags, force_flags=force_flags, n_workers=n_workers,
116
118
  basepath=cfg.config_path, pause=pause, do_print=do_print, verbose=verbose, save=save, **kw)
117
119
  passed,times = zip(*results)
118
120
  if all(passed): print("Success.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nbdev
3
- Version: 3.3.6
3
+ Version: 3.3.8
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,8 +16,8 @@ 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.2.3
20
- Requires-Dist: execnb>=0.2.8
19
+ Requires-Dist: fastcore>=2.2.7
20
+ Requires-Dist: execnb>=0.2.11
21
21
  Requires-Dist: astunparse
22
22
  Requires-Dist: ghapi>=2.0.2
23
23
  Requires-Dist: watchdog
@@ -1,5 +1,5 @@
1
- fastcore>=2.2.3
2
- execnb>=0.2.8
1
+ fastcore>=2.2.7
2
+ execnb>=0.2.11
3
3
  astunparse
4
4
  ghapi>=2.0.2
5
5
  watchdog
@@ -19,7 +19,7 @@ classifiers = [
19
19
  "License :: OSI Approved :: Apache Software License",
20
20
  ]
21
21
  dynamic = ["version"]
22
- dependencies = [ "fastcore>=2.2.3", "execnb>=0.2.8", "astunparse", "ghapi>=2.0.2", "watchdog", "asttokens",
22
+ dependencies = [ "fastcore>=2.2.7", "execnb>=0.2.11", "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
File without changes