ipykernel-helper 0.0.46__tar.gz → 0.0.48__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: ipykernel-helper
3
- Version: 0.0.46
3
+ Version: 0.0.48
4
4
  Summary: Helpers for ipykernel and friends
5
5
  Author-email: Jeremy Howard <info@fast.ai>
6
6
  License: Apache-2.0
@@ -17,7 +17,7 @@ Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
18
  Requires-Dist: python-fasthtml
19
19
  Requires-Dist: fastcore>=1.12.28
20
- Requires-Dist: toolslm>=0.3.13
20
+ Requires-Dist: toolslm>=0.3.37
21
21
  Requires-Dist: jedi
22
22
  Requires-Dist: ipython
23
23
  Requires-Dist: ipykernel
@@ -0,0 +1,2 @@
1
+ __version__ = "0.0.48"
2
+ from .core import *
@@ -5,7 +5,9 @@ d = { 'settings': { 'branch': 'main',
5
5
  'doc_host': 'https://AnswerDotAI.github.io',
6
6
  'git_url': 'https://github.com/AnswerDotAI/ipykernel-helper',
7
7
  'lib_path': 'ipykernel_helper'},
8
- 'syms': { 'ipykernel_helper.core': { 'ipykernel_helper.core.DisplayObject.__repr__': ( 'core.html#displayobject.__repr__',
8
+ 'syms': { 'ipykernel_helper.core': { 'ipykernel_helper.core.DisplayFormatter.format': ( 'core.html#displayformatter.format',
9
+ 'ipykernel_helper/core.py'),
10
+ 'ipykernel_helper.core.DisplayObject.__repr__': ( 'core.html#displayobject.__repr__',
9
11
  'ipykernel_helper/core.py'),
10
12
  'ipykernel_helper.core.Inspector._get_info': ( 'core.html#inspector._get_info',
11
13
  'ipykernel_helper/core.py'),
@@ -31,8 +33,6 @@ d = { 'settings': { 'branch': 'main',
31
33
  'ipykernel_helper/core.py'),
32
34
  'ipykernel_helper.core.InteractiveShell.xpush': ( 'core.html#interactiveshell.xpush',
33
35
  'ipykernel_helper/core.py'),
34
- 'ipykernel_helper.core.Markdown._repr_markdown_': ( 'core.html#markdown._repr_markdown_',
35
- 'ipykernel_helper/core.py'),
36
36
  'ipykernel_helper.core.SyntaxTB.structured_traceback': ( 'core.html#syntaxtb.structured_traceback',
37
37
  'ipykernel_helper/core.py'),
38
38
  'ipykernel_helper.core.ZMQShellDisplayHook.finish_displayhook': ( 'core.html#zmqshelldisplayhook.finish_displayhook',
@@ -51,6 +51,7 @@ d = { 'settings': { 'branch': 'main',
51
51
  'ipykernel_helper.core._safe_repr': ('core.html#_safe_repr', 'ipykernel_helper/core.py'),
52
52
  'ipykernel_helper.core._safe_sig': ('core.html#_safe_sig', 'ipykernel_helper/core.py'),
53
53
  'ipykernel_helper.core._signatures': ('core.html#_signatures', 'ipykernel_helper/core.py'),
54
+ 'ipykernel_helper.core.call_tool': ('core.html#call_tool', 'ipykernel_helper/core.py'),
54
55
  'ipykernel_helper.core.fix_editable_priority': ( 'core.html#fix_editable_priority',
55
56
  'ipykernel_helper/core.py'),
56
57
  'ipykernel_helper.core.get_md': ('core.html#get_md', 'ipykernel_helper/core.py'),
@@ -4,7 +4,7 @@
4
4
 
5
5
  # %% auto #0
6
6
  __all__ = ['transient', 'run_cmd', 'get_md', 'scrape_url', 'gh_blob_to_raw', 'read_gh_repo', 'read_url', 'fix_editable_priority',
7
- 'load_ipython_extension']
7
+ 'call_tool', 'load_ipython_extension']
8
8
 
9
9
  # %% ../nbs/00_core.ipynb #9470a755
10
10
  from fasthtml.common import *
@@ -37,6 +37,7 @@ from IPython.display import display,Markdown,HTML
37
37
  from IPython.core.oinspect import Inspector
38
38
  from IPython.core.displayhook import DisplayHook
39
39
  from ipykernel.displayhook import ZMQShellDisplayHook
40
+ from IPython.core.formatters import DisplayFormatter
40
41
 
41
42
  # %% ../nbs/00_core.ipynb #06cb0934
42
43
  warnings.filterwarnings('ignore', category=ProvisionalCompleterWarning)
@@ -333,10 +334,13 @@ def fix_editable_priority():
333
334
  try: sys.meta_path.append(sys.meta_path.pop(sys.meta_path.index(PathFinder)))
334
335
  except ValueError: pass
335
336
 
336
- # %% ../nbs/00_core.ipynb #e441d8a8
337
+ # %% ../nbs/00_core.ipynb #6d5eebf0
337
338
  @patch
338
- def _repr_markdown_(self:Markdown):
339
- return f'<div class="prose">\n\n{self.data}\n\n</div>'
339
+ def format(self:DisplayFormatter, obj, include=None, exclude=None):
340
+ data,meta = self._orig_format(obj, include=include, exclude=exclude)
341
+ if 'text/markdown' in data and not data['text/markdown'].lstrip().startswith('<div class="prose">'):
342
+ data['text/markdown'] = f'<div class="prose">\n\n{data["text/markdown"]}\n\n</div>'
343
+ return data,meta
340
344
 
341
345
  # %% ../nbs/00_core.ipynb #10d99f58
342
346
  from IPython.display import TextDisplayObject,DisplayObject
@@ -356,6 +360,11 @@ def finish_displayhook(self:ZMQShellDisplayHook):
356
360
  if obj is not None: self.msg['content']['metadata']['__type'] = type(obj).__qualname__
357
361
  self._orig_finish_displayhook()
358
362
 
363
+ # %% ../nbs/00_core.ipynb #b671332c
364
+ async def call_tool(func, kw):
365
+ "Call `func(**kw)` with `coerce_inputs`"
366
+ return await maybe_await(func(**coerce_inputs(func, kw)))
367
+
359
368
  # %% ../nbs/00_core.ipynb #cf893c28
360
369
  @patch
361
370
  def _get_info(self:Inspector, obj, oname='', formatter=None, info=None, detail_level=0, omit_sections=()):
@@ -404,6 +413,6 @@ def _await_cell_magic(lines):
404
413
 
405
414
  def load_ipython_extension(ip):
406
415
  ns = ip.user_ns
407
- for o in ('read_gh_repo','read_url','transient','run_cmd','maybe_await'): ns[o] = globals()[o]
416
+ for o in ('read_gh_repo','read_url','transient','run_cmd','maybe_await','call_tool'): ns[o] = globals()[o]
408
417
  lts = ip.input_transformer_manager.line_transforms
409
418
  if not any(getattr(f, '__name__', None) == '_await_cell_magic' for f in lts): lts.append(_await_cell_magic)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ipykernel-helper
3
- Version: 0.0.46
3
+ Version: 0.0.48
4
4
  Summary: Helpers for ipykernel and friends
5
5
  Author-email: Jeremy Howard <info@fast.ai>
6
6
  License: Apache-2.0
@@ -17,7 +17,7 @@ Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
18
  Requires-Dist: python-fasthtml
19
19
  Requires-Dist: fastcore>=1.12.28
20
- Requires-Dist: toolslm>=0.3.13
20
+ Requires-Dist: toolslm>=0.3.37
21
21
  Requires-Dist: jedi
22
22
  Requires-Dist: ipython
23
23
  Requires-Dist: ipykernel
@@ -1,6 +1,6 @@
1
1
  python-fasthtml
2
2
  fastcore>=1.12.28
3
- toolslm>=0.3.13
3
+ toolslm>=0.3.37
4
4
  jedi
5
5
  ipython
6
6
  ipykernel
@@ -12,7 +12,7 @@ license = {text = "Apache-2.0"}
12
12
  authors = [{name = "Jeremy Howard", email = "info@fast.ai"}]
13
13
  keywords = ['nbdev', 'jupyter', 'notebook', 'python']
14
14
  classifiers = ["Natural Language :: English", "Intended Audience :: Developers", "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only"]
15
- dependencies = ['python-fasthtml', 'fastcore>=1.12.28', 'toolslm>=0.3.13', 'jedi', 'ipython', 'ipykernel', 'beautifulsoup4', 'lxml', 'html2text', 'cloudscraper', 'ghapi']
15
+ dependencies = ['python-fasthtml', 'fastcore>=1.12.28', 'toolslm>=0.3.37', 'jedi', 'ipython', 'ipykernel', 'beautifulsoup4', 'lxml', 'html2text', 'cloudscraper', 'ghapi']
16
16
 
17
17
  [project.urls]
18
18
  Repository = "https://github.com/AnswerDotAI/ipykernel-helper"
@@ -28,6 +28,6 @@ version = {attr = "ipykernel_helper.__version__"}
28
28
  include = ["ipykernel_helper"]
29
29
 
30
30
  [tool.nbdev]
31
- allowed_metadata_keys = ['solveit_dialog_mode', 'solveit_ver']
32
- allowed_cell_metadata_keys = ["solveit_ai"]
31
+ allowed_metadata_keys = ['solveit']
32
+ allowed_cell_metadata_keys = ['solveit_ai']
33
33
  custom_sidebar = false
@@ -1,2 +0,0 @@
1
- __version__ = "0.0.46"
2
- from .core import *