Skip to content

Commit 7e26967

Browse files
authored
Import ensure-sync directly from dependence. (#1149)
1 parent 2cc810a commit 7e26967

File tree

18 files changed

+27
-18
lines changed

18 files changed

+27
-18
lines changed

jupyter_server/files/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
from base64 import decodebytes
66
from typing import List
77

8+
from jupyter_core.utils import ensure_async
89
from tornado import web
910

1011
from jupyter_server.auth import authorized
1112
from jupyter_server.base.handlers import JupyterHandler
12-
from jupyter_server.utils import ensure_async
1313

1414
AUTH_RESOURCE = "contents"
1515

jupyter_server/gateway/managers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
from jupyter_client.kernelspec import KernelSpecManager
1717
from jupyter_client.manager import AsyncKernelManager
1818
from jupyter_client.managerabc import KernelManagerABC
19+
from jupyter_core.utils import ensure_async
1920
from tornado import web
2021
from tornado.escape import json_decode, json_encode, url_escape, utf8
2122
from traitlets import DottedObjectName, Instance, Type, default
2223

2324
from .._tz import UTC
2425
from ..services.kernels.kernelmanager import AsyncMappingKernelManager
2526
from ..services.sessions.sessionmanager import SessionManager
26-
from ..utils import ensure_async, url_path_join
27+
from ..utils import url_path_join
2728
from .gateway_client import GatewayClient, gateway_request
2829

2930

jupyter_server/nbconvert/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
import zipfile
88

99
from anyio.to_thread import run_sync
10+
from jupyter_core.utils import ensure_async
1011
from nbformat import from_dict
1112
from tornado import web
1213
from tornado.log import app_log
1314

1415
from jupyter_server.auth import authorized
15-
from jupyter_server.utils import ensure_async
1616

1717
from ..base.handlers import FilesRedirectHandler, JupyterHandler, path_regex
1818

jupyter_server/serverapp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,10 @@
124124

125125
from jinja2 import Environment, FileSystemLoader
126126
from jupyter_core.paths import secure_write
127+
from jupyter_core.utils import ensure_async
127128

128129
from jupyter_server.transutils import _i18n, trans
129-
from jupyter_server.utils import ensure_async, pathname2url, urljoin
130+
from jupyter_server.utils import pathname2url, urljoin
130131

131132
# the minimum viable tornado version: needs to be kept in sync with setup.py
132133
MIN_TORNADO = (6, 1, 0)

jupyter_server/services/api/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
import os
66
from typing import Dict, List
77

8+
from jupyter_core.utils import ensure_async
89
from tornado import web
910

1011
from jupyter_server._tz import isoformat, utcfromtimestamp
1112
from jupyter_server.auth import authorized
12-
from jupyter_server.utils import ensure_async
1313

1414
from ...base.handlers import APIHandler, JupyterHandler
1515

jupyter_server/services/contents/handlers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
except ImportError:
1212
from jupyter_client.jsonutil import date_default as json_default
1313

14+
from jupyter_core.utils import ensure_async
1415
from tornado import web
1516

1617
from jupyter_server.auth import authorized
1718
from jupyter_server.base.handlers import APIHandler, JupyterHandler, path_regex
18-
from jupyter_server.utils import ensure_async, url_escape, url_path_join
19+
from jupyter_server.utils import url_escape, url_path_join
1920

2021
AUTH_RESOURCE = "contents"
2122

jupyter_server/services/contents/manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import warnings
88
from fnmatch import fnmatch
99

10+
from jupyter_core.utils import ensure_async
1011
from jupyter_events import EventLogger
1112
from nbformat import ValidationError, sign
1213
from nbformat import validate as validate_nb
@@ -17,7 +18,7 @@
1718

1819
from jupyter_server import DEFAULT_EVENTS_SCHEMA_PATH, JUPYTER_SERVER_EVENTS_URI
1920
from jupyter_server.transutils import _i18n
20-
from jupyter_server.utils import ensure_async, import_item
21+
from jupyter_server.utils import import_item
2122

2223
from ...files.handlers import FilesHandler
2324
from .checkpoints import AsyncCheckpoints, Checkpoints

jupyter_server/services/kernels/connection/channels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
except ImportError:
1919
from jupyter_client.jsonutil import date_default as json_default
2020

21-
from jupyter_client.utils import ensure_async
21+
from jupyter_core.utils import ensure_async
2222

2323
from jupyter_server.transutils import _i18n
2424

jupyter_server/services/kernels/handlers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
except ImportError:
1313
from jupyter_client.jsonutil import date_default as json_default
1414

15+
from jupyter_core.utils import ensure_async
1516
from tornado import web
1617

1718
from jupyter_server.auth import authorized
18-
from jupyter_server.utils import ensure_async, url_escape, url_path_join
19+
from jupyter_server.utils import url_escape, url_path_join
1920

2021
from ...base.handlers import APIHandler
2122

jupyter_server/services/kernels/kernelmanager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from jupyter_client.multikernelmanager import AsyncMultiKernelManager, MultiKernelManager
1717
from jupyter_client.session import Session
1818
from jupyter_core.paths import exists
19+
from jupyter_core.utils import ensure_async
1920
from tornado import web
2021
from tornado.concurrent import Future
2122
from tornado.ioloop import IOLoop, PeriodicCallback
@@ -35,7 +36,7 @@
3536

3637
from jupyter_server._tz import isoformat, utcnow
3738
from jupyter_server.prometheus.metrics import KERNEL_CURRENTLY_RUNNING_TOTAL
38-
from jupyter_server.utils import ensure_async, import_item, to_os_path
39+
from jupyter_server.utils import import_item, to_os_path
3940

4041

4142
class MappingKernelManager(MultiKernelManager):

0 commit comments

Comments
 (0)