execnb 0.2.8__tar.gz → 0.2.9__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: execnb
3
- Version: 0.2.8
3
+ Version: 0.2.9
4
4
  Summary: A description of your project
5
5
  Author-email: Jeremy Howard <j@fast.ai>
6
6
  License: Apache-2.0
@@ -0,0 +1 @@
1
+ __version__ = "0.2.9"
@@ -393,7 +393,8 @@ def nbrun(
393
393
  below:bool=False, # Also run all cells below the match?
394
394
  all:bool=False, # Run all code cells?
395
395
  exported:bool=False, # Only cells with `#| export` or `#| exports`?
396
- skip_noeval:bool=False # Skip `#| eval: false` and `nbdev_export` cells (like `nbdev-test`)?
396
+ skip_noeval:bool=False, # Skip `#| eval: false` and `nbdev_export` cells (like `nbdev-test`)?
397
+ stop_on_error:bool=True, # Stop after the first cell whose run errors?
397
398
  ):
398
399
  "Run cell(s) from a notebook by id prefix, printing rendered outputs"
399
400
  fname = ifnone(fname, getattr(self,'_nbrun_fname',None))
@@ -403,8 +404,9 @@ def nbrun(
403
404
  if all or not msgids: msgids = (None,)
404
405
  for msgid in msgids:
405
406
  for cell in select_cells(nb, msgid, above=above, below=below, all=all, exported=exported, skip_noeval=skip_noeval):
406
- res = render_text(self.run(cell.source))
407
- if res: print(f'--- {cell.id} ---\n{res}')
407
+ outs = self.run(cell.source)
408
+ if res := render_text(outs): print(f'--- {cell.id} ---\n{res}')
409
+ if stop_on_error and any(o.get('output_type')=='error' for o in outs): return
408
410
 
409
411
  # %% ../nbs/00_shell.ipynb #1227c8b1
410
412
  @call_parse
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: execnb
3
- Version: 0.2.8
3
+ Version: 0.2.9
4
4
  Summary: A description of your project
5
5
  Author-email: Jeremy Howard <j@fast.ai>
6
6
  License: Apache-2.0
@@ -1 +0,0 @@
1
- __version__ = "0.2.8"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes