Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jupyter/jupyter_client
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.3.4
Choose a base ref
...
head repository: jupyter/jupyter_client
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.3.5
Choose a head ref
Loading
Showing with 77 additions and 34 deletions.
  1. +0 −1 .github/workflows/downstream.yml
  2. +10 −14 .pre-commit-config.yaml
  3. +34 −2 CHANGELOG.md
  4. +16 −0 docs/api/client.rst
  5. +1 −1 jupyter_client/_version.py
  6. +7 −4 jupyter_client/client.py
  7. +6 −9 jupyter_client/ioloop/restarter.py
  8. +3 −3 pyproject.toml
1 change: 0 additions & 1 deletion .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
@@ -76,7 +76,6 @@ jobs:
git clone https://github.com/jupyter/jupyter_kernel_test.git
cd jupyter_kernel_test
conda env update --name jupyter_kernel_test --file environment.yml
conda install -c conda-forge xeus-cling
pip install -e ".[test]"
python -m unittest -v
24 changes: 10 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.3.0
hooks:
- id: end-of-file-fixer
- id: check-case-conflict
@@ -16,42 +16,38 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/asottile/reorder_python_imports
rev: v3.1.0
rev: v3.8.2
hooks:
- id: reorder-python-imports

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.6.0
hooks:
- id: black
args: ["--line-length", "100"]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.2
rev: v3.0.0-alpha.0
hooks:
- id: prettier

- repo: https://github.com/PyCQA/doc8
rev: 0.11.2
rev: v1.0.0
hooks:
- id: doc8
args: [--max-line-length=200]
stages: [manual]

- repo: https://github.com/pycqa/flake8
rev: 4.0.1
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies:
[
"flake8-bugbear==20.1.4",
"flake8-logging-format==0.6.0",
"flake8-implicit-str-concat==0.2.0",
]
["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0"]
stages: [manual]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.960
rev: v0.971
hooks:
- id: mypy
exclude: jupyter_client/tests
@@ -60,13 +56,13 @@ repos:
stages: [manual]

- repo: https://github.com/PyCQA/doc8
rev: 0.11.2
rev: v1.0.0
hooks:
- id: doc8
args: [--max-line-length=100]

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.16.0
rev: 0.17.1
hooks:
- id: check-jsonschema
name: "Check GitHub Workflows"
36 changes: 34 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,40 @@

<!-- <START NEW CHANGELOG ENTRY> -->

## 7.3.5

([Full Changelog](https://github.com/jupyter/jupyter_client/compare/v7.3.4...bc5ded5439ca55bd6740885eb3a44ca6bc3e2243))

### Enhancements made

- add `AsyncKernelClient` to `doc/api/client.rst` [#819](https://github.com/jupyter/jupyter_client/pull/819) ([@helioz11](https://github.com/helioz11))

### Bugs fixed

- Use tornado 6.2's PeriodicCallback in restarter [#822](https://github.com/jupyter/jupyter_client/pull/822) ([@vidartf](https://github.com/vidartf))
- Make \_stdin_hook_default async [#814](https://github.com/jupyter/jupyter_client/pull/814) ([@davidbrochart](https://github.com/davidbrochart))

### Maintenance and upkeep improvements

- [pre-commit.ci] pre-commit autoupdate [#824](https://github.com/jupyter/jupyter_client/pull/824) ([@pre-commit-ci](https://github.com/pre-commit-ci))
- [pre-commit.ci] pre-commit autoupdate [#821](https://github.com/jupyter/jupyter_client/pull/821) ([@pre-commit-ci](https://github.com/pre-commit-ci))
- [pre-commit.ci] pre-commit autoupdate [#820](https://github.com/jupyter/jupyter_client/pull/820) ([@pre-commit-ci](https://github.com/pre-commit-ci))
- [pre-commit.ci] pre-commit autoupdate [#818](https://github.com/jupyter/jupyter_client/pull/818) ([@pre-commit-ci](https://github.com/pre-commit-ci))
- [pre-commit.ci] pre-commit autoupdate [#816](https://github.com/jupyter/jupyter_client/pull/816) ([@pre-commit-ci](https://github.com/pre-commit-ci))
- [pre-commit.ci] pre-commit autoupdate [#815](https://github.com/jupyter/jupyter_client/pull/815) ([@pre-commit-ci](https://github.com/pre-commit-ci))
- [pre-commit.ci] pre-commit autoupdate [#812](https://github.com/jupyter/jupyter_client/pull/812) ([@pre-commit-ci](https://github.com/pre-commit-ci))
- [pre-commit.ci] pre-commit autoupdate [#810](https://github.com/jupyter/jupyter_client/pull/810) ([@pre-commit-ci](https://github.com/pre-commit-ci))
- [pre-commit.ci] pre-commit autoupdate [#809](https://github.com/jupyter/jupyter_client/pull/809) ([@pre-commit-ci](https://github.com/pre-commit-ci))
- [pre-commit.ci] pre-commit autoupdate [#807](https://github.com/jupyter/jupyter_client/pull/807) ([@pre-commit-ci](https://github.com/pre-commit-ci))

### Contributors to this release

([GitHub contributors page for this release](https://github.com/jupyter/jupyter_client/graphs/contributors?from=2022-06-08&to=2022-08-25&type=c))

[@blink1073](https://github.com/search?q=repo%3Ajupyter%2Fjupyter_client+involves%3Ablink1073+updated%3A2022-06-08..2022-08-25&type=Issues) | [@davidbrochart](https://github.com/search?q=repo%3Ajupyter%2Fjupyter_client+involves%3Adavidbrochart+updated%3A2022-06-08..2022-08-25&type=Issues) | [@helioz11](https://github.com/search?q=repo%3Ajupyter%2Fjupyter_client+involves%3Ahelioz11+updated%3A2022-06-08..2022-08-25&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter%2Fjupyter_client+involves%3Apre-commit-ci+updated%3A2022-06-08..2022-08-25&type=Issues) | [@vidartf](https://github.com/search?q=repo%3Ajupyter%2Fjupyter_client+involves%3Avidartf+updated%3A2022-06-08..2022-08-25&type=Issues)

<!-- <END NEW CHANGELOG ENTRY> -->

## 7.3.4

([Full Changelog](https://github.com/jupyter/jupyter_client/compare/v7.3.3...ca4cb2d6a4b95a6925de85a47b323d2235032c74))
@@ -21,8 +55,6 @@

[@blink1073](https://github.com/search?q=repo%3Ajupyter%2Fjupyter_client+involves%3Ablink1073+updated%3A2022-06-07..2022-06-08&type=Issues) | [@ccordoba12](https://github.com/search?q=repo%3Ajupyter%2Fjupyter_client+involves%3Accordoba12+updated%3A2022-06-07..2022-06-08&type=Issues) | [@pre-commit-ci](https://github.com/search?q=repo%3Ajupyter%2Fjupyter_client+involves%3Apre-commit-ci+updated%3A2022-06-07..2022-06-08&type=Issues)

<!-- <END NEW CHANGELOG ENTRY> -->

## 7.3.3

([Full Changelog](https://github.com/jupyter/jupyter_client/compare/v7.3.2...37ca37d865db260e7da6fa85339be450d6fd3c3c))
16 changes: 16 additions & 0 deletions docs/api/client.rst
Original file line number Diff line number Diff line change
@@ -35,3 +35,19 @@ client - communicating with kernels
.. autoclass:: BlockingKernelClient

.. automethod:: execute_interactive

.. automethod:: get_shell_msg

.. automethod:: get_iopub_msg

.. automethod:: get_stdin_msg

.. automethod:: get_control_msg

.. automethod:: wait_for_ready

.. automethod:: is_alive

.. autoclass:: AsyncKernelClient

:class:`AsyncKernelClient` is identical to :class:`BlockingKernelClient` but the methods described above are async.
2 changes: 1 addition & 1 deletion jupyter_client/_version.py
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
from typing import List
from typing import Union

__version__ = "7.3.4"
__version__ = "7.3.5"

# Build up version_info tuple for backwards compatibility
pattern = r'(?P<major>\d+).(?P<minor>\d+).(?P<patch>\d+)(?P<rest>.*)'
11 changes: 7 additions & 4 deletions jupyter_client/client.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import asyncio
import inspect
import sys
import time
import typing as t
@@ -232,7 +233,7 @@ async def _async_recv_reply(
continue
return reply

def _stdin_hook_default(self, msg: t.Dict[str, t.Any]) -> None:
async def _stdin_hook_default(self, msg: t.Dict[str, t.Any]) -> None:
"""Handle an input request"""
content = msg["content"]
if content.get("password", False):
@@ -251,7 +252,7 @@ def _stdin_hook_default(self, msg: t.Dict[str, t.Any]) -> None:

# only send stdin reply if there *was not* another request
# or execution finished while we were reading.
if not (self.stdin_channel.msg_ready() or self.shell_channel.msg_ready()):
if not (await self.stdin_channel.msg_ready() or await self.shell_channel.msg_ready()):
self.input(raw_data)

def _output_hook_default(self, msg: t.Dict[str, t.Any]) -> None:
@@ -469,7 +470,7 @@ async def _async_execute_interactive(
If not specified, output will be redisplayed.
stdin_hook: callable(msg)
Function to be called with stdin_request messages.
Function or awaitable to be called with stdin_request messages.
If not specified, input/getpass will be called.
Returns
@@ -536,7 +537,9 @@ async def _async_execute_interactive(
raise TimeoutError("Timeout waiting for output")
if stdin_socket in events:
req = await self.stdin_channel.get_msg(timeout=0)
stdin_hook(req)
res = stdin_hook(req)
if inspect.isawaitable(res):
await res
continue
if iopub_socket not in events:
continue
15 changes: 6 additions & 9 deletions jupyter_client/ioloop/restarter.py
Original file line number Diff line number Diff line change
@@ -5,15 +5,12 @@
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import asyncio
import time
import warnings

from traitlets import Instance
from zmq.eventloop import ioloop

from jupyter_client.restarter import KernelRestarter
from jupyter_client.utils import run_sync


class IOLoopKernelRestarter(KernelRestarter):
@@ -27,19 +24,19 @@ def _loop_default(self):
DeprecationWarning,
stacklevel=4,
)
from zmq.eventloop import ioloop

return ioloop.IOLoop.current()

_pcallback = None

def start(self):
"""Start the polling of the kernel."""
if self._pcallback is None:
if asyncio.iscoroutinefunction(self.poll):
cb = run_sync(self.poll)
else:
cb = self.poll
self._pcallback = ioloop.PeriodicCallback(
cb,
from tornado.ioloop import PeriodicCallback

self._pcallback = PeriodicCallback(
self.poll,
1000 * self.time_to_dead,
)
self._pcallback.start()
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "jupyter_client"
version = "7.3.4"
version = "7.3.5"
description = "Jupyter protocol implementation and client libraries"
keywords = [ "Interactive", "Interpreter", "Shell", "Web",]
classifiers = [
@@ -29,7 +29,7 @@ dependencies = [
"nest-asyncio>=1.5.4",
"python-dateutil>=2.8.2",
"pyzmq>=23.0",
"tornado>=6.0",
"tornado>=6.2",
"traitlets",
]

@@ -93,7 +93,7 @@ skip = ["check-links"]
ignore = [".mailmap", "*.yml", "*.yaml"]

[tool.tbump.version]
current = "7.3.4"
current = "7.3.5"
regex = '''
(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
((?P<channel>a|b|rc|.dev)(?P<release>\d+))?