Skip to content

Commit 4ed698a

Browse files
committed
Merge branch 'master' of github.com:jupyter/jupyter_client into port-already-in-use
2 parents abbf40e + 5a8d7f8 commit 4ed698a

File tree

7 files changed

+14
-2
lines changed

7 files changed

+14
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ __pycache__
1414
\#*#
1515
.#*
1616
.coverage
17+
.cache
18+
absolute.json

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The last command runs the test suite to verify the setup. During development, yo
3333
The documentation of Jupyter Client is generated from the files in `docs/` using Sphinx. Instructions for setting up Sphinx with a selection of optional modules are in the [Documentation Guide](http://jupyter.readthedocs.io/en/latest/contrib_docs/index.html). You'll also need the `make` command.
3434
For a minimal Sphinx installation to process the Jupyter Client docs, execute:
3535

36-
pip install sphinx sphinx_rtd_theme
36+
pip install ipykernel sphinx sphinx_rtd_theme
3737

3838
The following commands build the documentation in HTML format and check for broken links:
3939

docs/api/kernelspec.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ kernelspec - discovering kernels
2525
The name of the language the kernel implements, to help with picking
2626
appropriate kernels when loading notebooks.
2727

28+
.. attribute:: metadata
29+
30+
Additional kernel-specific metadata; clients can use this as needed,
31+
for instance to aid in kernel selection and filtering.
32+
2833
.. attribute:: resource_dir
2934

3035
The path to the directory with this kernel's resources, such as icons.

docs/kernels.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ JSON serialised dictionary containing the following keys and values:
135135
- **env** (optional): A dictionary of environment variables to set for the kernel.
136136
These will be added to the current environment variables before the kernel is
137137
started.
138+
- **metadata** (optional): A dictionary of additional attributes about this
139+
kernel; used by clients to aid clients in kernel selection.
138140

139141
For example, the kernel.json file for IPython looks like this::
140142

jupyter_client/kernelspec.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class KernelSpec(HasTraits):
2828
language = Unicode()
2929
env = Dict()
3030
resource_dir = Unicode()
31+
metadata = Dict()
3132

3233
@classmethod
3334
def from_resource_dir(cls, resource_dir):
@@ -45,6 +46,7 @@ def to_dict(self):
4546
env=self.env,
4647
display_name=self.display_name,
4748
language=self.language,
49+
metadata=self.metadata,
4850
)
4951

5052
return d

jupyter_client/tests/test_kernelspec.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def test_get_kernel_spec(self):
6767
self.assertEqual(ks.argv, sample_kernel_json['argv'])
6868
self.assertEqual(ks.display_name, sample_kernel_json['display_name'])
6969
self.assertEqual(ks.env, {})
70+
self.assertEqual(ks.metadata, {})
7071

7172
def test_find_all_specs(self):
7273
kernels = self.ksm.get_all_specs()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
]
8383

8484
extras_require = setuptools_args['extras_require'] = {
85-
'test': ['ipykernel', 'ipython', 'pytest'],
85+
'test': ['ipykernel', 'ipython', 'mock', 'pytest'],
8686
}
8787

8888
if 'setuptools' in sys.modules:

0 commit comments

Comments
 (0)