Skip to content

Commit

Permalink
Remove deprecated zmq imports (jupyter#915)
Browse files Browse the repository at this point in the history
closes jupyter#842

(cherry picked from commit 3161087)
  • Loading branch information
blink1073 committed Feb 27, 2024
1 parent c16c0c9 commit ce184e3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 3 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
repos:
- repo: https://github.com/asottile/reorder_python_imports
rev: v1.9.0
hooks:
- id: reorder-python-imports
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 24.2.0
hooks:
- id: black
args: ["--line-length", "100"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.2.1
hooks:
- id: prettier
- repo: https://gitlab.com/pycqa/flake8
rev: "3.8.4"
- repo: https://github.com/PyCQA/flake8
rev: "7.0.0"
hooks:
- id: flake8
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
3 changes: 3 additions & 0 deletions jupyter_client/ioloop/restarter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This watches a kernel's state using KernelManager.is_alive and auto
restarts the kernel if it dies.
"""

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import warnings
Expand All @@ -24,6 +25,8 @@ def _loop_default(self):
DeprecationWarning,
stacklevel=4,
)
from tornado import ioloop

return ioloop.IOLoop.current()

_pcallback = None
Expand Down
7 changes: 4 additions & 3 deletions jupyter_client/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Sessions.
* A Message object for convenience that allows attribute-access to the msg dict.
"""

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import hashlib
Expand All @@ -27,6 +28,7 @@
) # We are using compare_digest to limit the surface of timing attacks

import zmq
from tornado.ioloop import IOLoop
from traitlets import Any # type: ignore
from traitlets import Bool
from traitlets import CBytes
Expand All @@ -43,7 +45,6 @@
from traitlets.config.configurable import LoggingConfigurable
from traitlets.log import get_logger # type: ignore
from traitlets.utils.importstring import import_item # type: ignore
from zmq.eventloop.ioloop import IOLoop
from zmq.eventloop.zmqstream import ZMQStream
from zmq.utils import jsonapi

Expand Down Expand Up @@ -444,7 +445,7 @@ def _new_auth(self) -> None:

digest_history = Set()
digest_history_size = Integer(
2 ** 16,
2**16,
config=True,
help="""The maximum number of digests to remember.
Expand Down Expand Up @@ -483,7 +484,7 @@ def _unpack_changed(self, change):

# thresholds:
copy_threshold = Integer(
2 ** 16,
2**16,
config=True,
help="Threshold (in bytes) beyond which a buffer should be sent without copying.",
)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
max-line-length = 100
max-line-length = 105

[bdist_wheel]
universal=0
Expand Down

0 comments on commit ce184e3

Please sign in to comment.