execnb 0.3.2__py3-none-any.whl → 0.3.3__py3-none-any.whl

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.
execnb/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.3.2"
1
+ __version__ = "0.3.3"
execnb/shell.py CHANGED
@@ -16,6 +16,8 @@ from fastcore.ansi import strip_ansi
16
16
 
17
17
  import asyncio,io,multiprocessing,threading,types,traceback,builtins
18
18
  from contextlib import contextmanager,suppress
19
+ from datetime import datetime,timezone
20
+ from time import perf_counter
19
21
  try:
20
22
  if sys.platform == 'darwin': multiprocessing.set_start_method("fork")
21
23
  except RuntimeError: pass # if re-running cell
@@ -286,7 +288,10 @@ def cell(self:CaptureShell, cell, stdout=True, stderr=True, verbose=False, timeo
286
288
  "Run `cell`, skipping if not code, and store outputs (and the execution count) back in cell"
287
289
  if cell.cell_type!='code': return
288
290
  self._cell_idx = cell.idx_ + 1
291
+ st,t0 = datetime.now(timezone.utc),perf_counter()
289
292
  outs = self.run(cell.source, stdout=stdout, stderr=stderr, verbose=verbose, timeout=timeout)
293
+ cell.metadata['execution'] = {'iopub.execute_input': st.isoformat(),
294
+ 'shell.execute_reply': datetime.now(timezone.utc).isoformat(), 'total': perf_counter()-t0}
290
295
  cell.outputs = _dict2obj(outs) if outs else []
291
296
  cell.execution_count = self.execution_count-1 # the count this run used: the shell has already advanced
292
297
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: execnb
3
- Version: 0.3.2
3
+ Version: 0.3.3
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,9 @@
1
+ execnb/__init__.py,sha256=8KcCYTXH99C2-gCLuPILJvtT9YftRWJsartIx6TQ2ZY,22
2
+ execnb/_modidx.py,sha256=MjNuUL_bi4wfGKPaqwskCCqi4at5zy9Ju2YxO5qv6L0,6165
3
+ execnb/shell.py,sha256=DnvsFX-t1TILM8h494O3WHaRpWsXhdPEWjawGeZpp6M,20383
4
+ execnb-0.3.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
5
+ execnb-0.3.3.dist-info/METADATA,sha256=GC1arI3kaZplVnqUScNhXRpT4OKPLTb8xKgjIS_SW84,3347
6
+ execnb-0.3.3.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
7
+ execnb-0.3.3.dist-info/entry_points.txt,sha256=jZ8LPZCqnu4hXN_AgQpm05hVnTE-C25YK_4aiVX4i78,84
8
+ execnb-0.3.3.dist-info/top_level.txt,sha256=VGWmzsw8FOlT1r5TdOxaTWIAyRdclcxNdJ2r1hojf5U,7
9
+ execnb-0.3.3.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- execnb/__init__.py,sha256=vNiWJ14r_cw5t_7UDqDQIVZvladKFGyHH2avsLpN7Vg,22
2
- execnb/_modidx.py,sha256=MjNuUL_bi4wfGKPaqwskCCqi4at5zy9Ju2YxO5qv6L0,6165
3
- execnb/shell.py,sha256=RAs7b6khhpdvRe8RdaVWqiFG6_5CGFXLs7l8whfY1E4,20088
4
- execnb-0.3.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
5
- execnb-0.3.2.dist-info/METADATA,sha256=zjIJtSSLwiCLjiN_gfxt_sQ69ZI8xdJt1pJAoLZ8fd8,3347
6
- execnb-0.3.2.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
7
- execnb-0.3.2.dist-info/entry_points.txt,sha256=jZ8LPZCqnu4hXN_AgQpm05hVnTE-C25YK_4aiVX4i78,84
8
- execnb-0.3.2.dist-info/top_level.txt,sha256=VGWmzsw8FOlT1r5TdOxaTWIAyRdclcxNdJ2r1hojf5U,7
9
- execnb-0.3.2.dist-info/RECORD,,
File without changes