Skip to content

Commit dd8ef29

Browse files
author
Steven Silvester
authored
Merge pull request #681 from jupyter/blink1073-patch-3-1
Create migration.md
2 parents 31750bc + 21b9580 commit dd8ef29

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ with Jupyter kernels.
3636
:caption: Changes
3737

3838
changelog
39+
migration
3940

4041

4142
Indices and tables

docs/migration.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Migration Guide
2+
3+
## Jupyter Client 6.0 to 7.0
4+
5+
### API Changes
6+
7+
All of the API changes for `KernelManager` and `AsyncKernelManager` in the 7.0 release were confined to _internal public_ methods, which we define as methods called from the _formally public_ methods but could be overridden in subclass implementations. As a result, these changes may impact subclasses of `KernelManager` or `AsyncKernelManager` provided those implementations also implement or call these methods, but should not affect applications that call only the _formally public_ methods.
8+
9+
#### `KernelManager`
10+
11+
The following internal methods had signature changes:
12+
13+
- `def pre_start_kernel(self, **kwargs) -> Tuple[List[str], Dict[str, Any]]:`
14+
- `pre_start_kernel` now returns a tuple consisting of the formatted kernel startup list and an updated set of keyword arguments.
15+
- `def _launch_kernel(self, kernel_cmd: List[str], **kw) -> None:`
16+
- `_launch_kernel` now returns `None` instead of the `Popen` instance
17+
- These methods now take the keyword argument `restart` indicating the shutdown was on behalf of a kernel restart (when `True`).
18+
19+
- `def finish_shutdown(self, restart: bool = False):`
20+
- `def _kill_kernel(self, restart: bool = False):`
21+
- `def _send_kernel_sigterm(self, restart: bool = False):`
22+
23+
- Attribute `kernel` has been removed and _logically_ replaced with `provisioner` - which is an instance of `KernelProvisionerBase` and can be viewed as an abstract `Popen` instance.
24+
25+
#### `AsyncKernelManager`
26+
27+
Besides the signature and attribute changes described above, the following internal methods were made `async` for `AsyncKernelManager`:
28+
29+
- `async def pre_start_kernel(self, **kwargs) -> Tuple[List[str], Dict[str, Any]]:`
30+
- `async def post_start_kernel(self, **kwargs)`
31+
- `async def request_shutdown(self, restart: bool = False):`
32+
- `async def cleanup_resources(self, restart: bool = False):`
33+
34+
#### `ZMQSocketChannel`
35+
36+
- `async def get_msg(self, timeout: t.Optional[float] = None) -> t.Dict[str, t.Any]:`:
37+
We dropped the `block: bool = True` keyword argument. Calling this method with `block=False` previously translates to calling it with `timeout=0` now.
38+
39+
### Deprecations removed
40+
41+
#### Method `KernelManager.cleanup()`
42+
43+
The `cleanup()` method on `KernelManager` has been removed. `cleanup_resources(restart: bool = False)` should be used.
44+
45+
#### Attribute `KernelManager.kernel_cmd`
46+
47+
This attribute had been marked for deprecation for 4 years. The command used to start the kernel is derived from the `argv` stanza of the kernel specification file (`kernel.json`).

0 commit comments

Comments
 (0)