Skip to content

Commit 9aa92d8

Browse files
authored
Merge branch 'master' into patch-1
2 parents 4494b78 + be6d7e7 commit 9aa92d8

File tree

10 files changed

+31
-12
lines changed

10 files changed

+31
-12
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.3.0
2+
current_version = 0.3.1
33
commit = True
44
tag = True
55
tag_name = {new_version}

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ global-exclude .ipynb_checkpoints
3636
# Binder files to be excluded
3737
exclude binder
3838
recursive-exclude binder *.ipynb
39-
recursive-exclude binder *.txt
39+
recursive-exclude binder *.yml
4040

4141
# Exclude CI/CD files
4242
prune .circleci

binder/environment.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: nbclient
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- numpy
6+
- pandas
7+
- matplotlib
8+
- nteract-scrapbook
9+
- nbformat
10+
- nbclient

binder/requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.3.1
4+
5+
### Fixes
6+
7+
- Check that a kernel manager exists before cleaning up the kernel [#61](https://github.com/jupyter/nbclient/pull/61)
8+
- Force client class to be async when kernel manager is MultiKernelManager [#55](https://github.com/jupyter/nbclient/pull/55)
9+
- Replace pip install with conda install in Binder [#54](https://github.com/jupyter/nbclient/pull/54)
10+
311
## 0.3.0
412

513
### Major Changes

docs/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
'sphinx.ext.intersphinx',
3737
'sphinx.ext.mathjax',
3838
'sphinx.ext.napoleon',
39+
'myst_parser',
3940
]
4041

4142
# Add any paths that contain templates here, relative to this directory.
@@ -44,7 +45,7 @@
4445
# The suffix(es) of source filenames.
4546
# You can specify multiple suffix as a list of string:
4647
#
47-
source_suffix = ['.rst', '.md', '.ipynb']
48+
source_suffix = ['.rst', '.md']
4849

4950
# The master toctree document.
5051
master_doc = 'index'

docs/requirements-doc.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ Sphinx>=1.7
22
sphinx-book-theme
33
mock
44
moto
5+
myst-parser

nbclient/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = '0.3.0'
1+
version = '0.3.1'

nbclient/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,9 @@ async def async_start_new_kernel_client(self, **kwargs):
388388
except AttributeError:
389389
raise AttributeError('self.km={} has no client() or get_kernel() method, '
390390
'what is this?'.format(self.km))
391+
# since self.km is a MultiKernelManager, it might not be async
392+
# so let's ensure the client is async
393+
km.client_class = 'jupyter_client.asynchronous.AsyncKernelClient'
391394

392395
self.kc = km.client()
393396
await ensure_async(self.kc.start_channels())
@@ -467,7 +470,7 @@ async def async_execute(self, **kwargs):
467470
The executed notebook.
468471
"""
469472
reset_kc = kwargs.pop('reset_kc', False)
470-
if reset_kc:
473+
if reset_kc and self.km:
471474
await self._async_cleanup_kernel()
472475
self.reset_execution_trackers()
473476

nbclient/tests/test_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import IPython
2121
from traitlets import TraitError
2222
from nbformat import NotebookNode
23+
from jupyter_client.asynchronous import AsyncKernelClient
2324
from jupyter_client import KernelManager, MultiKernelManager
2425
from jupyter_client.kernelspec import KernelSpecManager
2526
from nbconvert.filters import strip_ansi
@@ -424,8 +425,8 @@ def test_startnewkernel_with_multikernelmanager():
424425
kc, kernel_id = executor.start_new_kernel_client()
425426
# a multi kernel manager always gives back an id to the started kernel
426427
assert kernel_id is not None
427-
# prove it initalized client
428-
assert kc is not None
428+
# prove it initalized an async client
429+
assert isinstance(kc, AsyncKernelClient)
429430
# since we are not using the setup_kernel context manager,
430431
# cleanup has to be done manually
431432
kc.shutdown()

0 commit comments

Comments
 (0)