Skip to content

Commit 5f76fda

Browse files
author
Mariko Wakabayashi
authored
Upgrade anyio to 3.1 for all py versions (#521)
1 parent 83a49c8 commit 5f76fda

File tree

6 files changed

+6
-32
lines changed

6 files changed

+6
-32
lines changed

jupyter_server/services/contents/filecheckpoints.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414
)
1515
from .fileio import AsyncFileManagerMixin, FileManagerMixin
1616

17-
try:
18-
from anyio.to_thread import run_sync
19-
except ImportError:
20-
# fallback on anyio v2 for python version < 3.7
21-
from anyio import run_sync_in_worker_thread as run_sync
22-
17+
from anyio.to_thread import run_sync
2318
from jupyter_core.utils import ensure_dir_exists
2419
from traitlets import Unicode
2520

jupyter_server/services/contents/fileio.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@
1212
import os
1313
import shutil
1414

15-
try:
16-
from anyio.to_thread import run_sync
17-
except ImportError:
18-
# fallback on anyio v2 for python version < 3.7
19-
from anyio import run_sync_in_worker_thread as run_sync
20-
15+
from anyio.to_thread import run_sync
2116
from tornado.web import HTTPError
2217

2318
from jupyter_server.utils import (

jupyter_server/services/contents/filemanager.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@
1212
import mimetypes
1313
import nbformat
1414

15-
try:
16-
from anyio.to_thread import run_sync
17-
except ImportError:
18-
# fallback on anyio v2 for python version < 3.7
19-
from anyio import run_sync_in_worker_thread as run_sync
20-
15+
from anyio.to_thread import run_sync
2116
from send2trash import send2trash
2217
from tornado import web
2318

jupyter_server/services/contents/largefilemanager.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
try:
2-
from anyio.to_thread import run_sync
3-
except ImportError:
4-
# fallback on anyio v2 for python version < 3.7
5-
from anyio import run_sync_in_worker_thread as run_sync
6-
1+
from anyio.to_thread import run_sync
72
from tornado import web
83
import base64
94
import os, io

jupyter_server/services/nbconvert/handlers.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import json
22

3-
try:
4-
from anyio.to_thread import run_sync
5-
except ImportError:
6-
# fallback on anyio v2 for python version < 3.7
7-
from anyio import run_sync_in_worker_thread as run_sync
8-
3+
from anyio.to_thread import run_sync
94
from tornado import web
105

116
from ...base.handlers import APIHandler

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ install_requires =
4040
Send2Trash
4141
terminado>=0.8.3
4242
prometheus_client
43-
anyio>=2.0.2,<3 ; python_version < '3.7'
44-
anyio>=3.0.1,<4 ; python_version >= '3.7'
43+
anyio>=3.1.0,<4
4544
websocket-client
4645

4746
[options.extras_require]

0 commit comments

Comments
 (0)