Skip to content

Commit 93d6f1a

Browse files
authored
Merge branch 'main' into fix-prefdir
2 parents 05467e5 + 493f367 commit 93d6f1a

File tree

15 files changed

+110
-64
lines changed

15 files changed

+110
-64
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
# Set update schedule for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
# Check for updates to GitHub Actions every weekday
8+
interval: "weekly"

.github/workflows/check-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v3
1414
- name: Base Setup
1515
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
1616
- name: Install Dependencies

.github/workflows/downstream.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1515

1616
- name: Base Setup
1717
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
@@ -41,7 +41,7 @@ jobs:
4141

4242
steps:
4343
- name: Checkout
44-
uses: actions/checkout@v2
44+
uses: actions/checkout@v3
4545

4646
- name: Base Setup
4747
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
@@ -57,7 +57,7 @@ jobs:
5757

5858
steps:
5959
- name: Checkout
60-
uses: actions/checkout@v2
60+
uses: actions/checkout@v3
6161

6262
- name: Base Setup
6363
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
python-version: ["3.8", "3.9", "3.10", "3.11", "pypy-3.8"]
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v3
1818
- name: Base Setup
1919
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
2020
- name: Install the Python dependencies

.github/workflows/python-tests.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
python-version: "3.10"
2929
steps:
3030
- name: Checkout
31-
uses: actions/checkout@v2
31+
uses: actions/checkout@v3
3232
- name: Base Setup
3333
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
3434
- name: Run the tests
@@ -52,7 +52,7 @@ jobs:
5252
python-version: ["3.10"]
5353
steps:
5454
- name: Checkout
55-
uses: actions/checkout@v2
55+
uses: actions/checkout@v3
5656
- name: Base Setup
5757
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
5858
- run: |
@@ -63,9 +63,9 @@ jobs:
6363
name: pre-commit
6464
runs-on: ubuntu-latest
6565
steps:
66-
- uses: actions/checkout@v2
67-
- uses: actions/setup-python@v2
68-
- uses: pre-commit/action@v2.0.0
66+
- uses: actions/checkout@v3
67+
- uses: actions/setup-python@v4
68+
- uses: pre-commit/action@v3.0.0
6969
with:
7070
extra_args: --all-files --hook-stage=manual
7171
- name: Help message if pre-commit fail
@@ -83,7 +83,7 @@ jobs:
8383
name: Test Docs
8484
runs-on: ubuntu-latest
8585
steps:
86-
- uses: actions/checkout@v2
86+
- uses: actions/checkout@v3
8787
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
8888
- run: hatch run docs:build
8989

@@ -92,7 +92,7 @@ jobs:
9292
timeout-minutes: 10
9393
runs-on: ubuntu-latest
9494
steps:
95-
- uses: actions/checkout@v2
95+
- uses: actions/checkout@v3
9696
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
9797
- name: Install the Python dependencies for the examples
9898
run: |
@@ -107,7 +107,7 @@ jobs:
107107
timeout-minutes: 20
108108
runs-on: ubuntu-latest
109109
steps:
110-
- uses: actions/checkout@v2
110+
- uses: actions/checkout@v3
111111
- name: Base Setup
112112
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
113113
with:
@@ -124,7 +124,7 @@ jobs:
124124
timeout-minutes: 20
125125
steps:
126126
- name: Checkout
127-
uses: actions/checkout@v2
127+
uses: actions/checkout@v3
128128
- name: Base Setup
129129
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
130130
with:
@@ -146,7 +146,7 @@ jobs:
146146
runs-on: ubuntu-latest
147147
timeout-minutes: 10
148148
steps:
149-
- uses: actions/checkout@v2
149+
- uses: actions/checkout@v3
150150
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
151151
- uses: jupyterlab/maintainer-tools/.github/actions/make-sdist@v1
152152

@@ -167,7 +167,7 @@ jobs:
167167
runs-on: ubuntu-latest
168168
timeout-minutes: 15
169169
steps:
170-
- uses: actions/checkout@v2
170+
- uses: actions/checkout@v3
171171
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
172172
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
173173

@@ -176,8 +176,11 @@ jobs:
176176
needs:
177177
- build
178178
- pre-commit
179+
- test_docs
180+
- test_minimum_versions
179181
- test_prereleases
180-
- make_sdist
182+
- client8
183+
- check_links
181184
- test_sdist
182185
runs-on: ubuntu-latest
183186
steps:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ repos:
7070
stages: [manual]
7171

7272
- repo: https://github.com/pre-commit/mirrors-eslint
73-
rev: v8.26.0
73+
rev: v8.27.0
7474
hooks:
7575
- id: eslint
7676
stages: [manual]

jupyter_server/pytest_plugin.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
from jupyter_server.auth import Authorizer
2727
from jupyter_server.extension import serverextension
2828
from jupyter_server.serverapp import JUPYTER_SERVICE_HANDLERS, ServerApp
29-
from jupyter_server.services.contents.filemanager import FileContentsManager
30-
from jupyter_server.services.contents.largefilemanager import LargeFileManager
29+
from jupyter_server.services.contents.filemanager import AsyncFileContentsManager
30+
from jupyter_server.services.contents.largefilemanager import AsyncLargeFileManager
3131
from jupyter_server.utils import url_path_join
3232

3333
# List of dependencies needed for this plugin.
@@ -488,14 +488,14 @@ def jp_kernelspecs(jp_data_dir):
488488

489489
@pytest.fixture(params=[True, False])
490490
def jp_contents_manager(request, tmp_path):
491-
"""Returns a FileContentsManager instance based on the use_atomic_writing parameter value."""
492-
return FileContentsManager(root_dir=str(tmp_path), use_atomic_writing=request.param)
491+
"""Returns an AsyncFileContentsManager instance based on the use_atomic_writing parameter value."""
492+
return AsyncFileContentsManager(root_dir=str(tmp_path), use_atomic_writing=request.param)
493493

494494

495495
@pytest.fixture
496496
def jp_large_contents_manager(tmp_path):
497-
"""Returns a LargeFileManager instance."""
498-
return LargeFileManager(root_dir=str(tmp_path))
497+
"""Returns an AsyncLargeFileManager instance."""
498+
return AsyncLargeFileManager(root_dir=str(tmp_path))
499499

500500

501501
@pytest.fixture

jupyter_server/serverapp.py

Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import gettext
77
import hashlib
88
import hmac
9-
import inspect
109
import ipaddress
1110
import json
1211
import logging
@@ -57,8 +56,8 @@
5756
if not sys.platform.startswith("win"):
5857
from tornado.netutil import bind_unix_socket
5958

60-
from jupyter_client import KernelManager
6159
from jupyter_client.kernelspec import KernelSpecManager
60+
from jupyter_client.manager import KernelManager
6261
from jupyter_client.session import Session
6362
from jupyter_core.application import JupyterApp, base_aliases, base_flags
6463
from jupyter_core.paths import jupyter_runtime_dir
@@ -123,7 +122,7 @@
123122
AsyncFileContentsManager,
124123
FileContentsManager,
125124
)
126-
from jupyter_server.services.contents.largefilemanager import LargeFileManager
125+
from jupyter_server.services.contents.largefilemanager import AsyncLargeFileManager
127126
from jupyter_server.services.contents.manager import (
128127
AsyncContentsManager,
129128
ContentsManager,
@@ -133,7 +132,6 @@
133132
MappingKernelManager,
134133
)
135134
from jupyter_server.services.sessions.sessionmanager import SessionManager
136-
from jupyter_server.traittypes import TypeFromClasses
137135
from jupyter_server.utils import (
138136
check_pid,
139137
fetch,
@@ -1164,7 +1162,7 @@ def _deprecated_password_config(self, change):
11641162
config=True,
11651163
help="""Disable cross-site-request-forgery protection
11661164
1167-
Jupyter notebook 4.3.1 introduces protection from cross-site request forgeries,
1165+
Jupyter server includes protection from cross-site request forgeries,
11681166
requiring API requests to either:
11691167
11701168
- originate from pages served by this server (validated with XSRF cookie and token), or
@@ -1435,38 +1433,13 @@ def template_file_path(self):
14351433
help="""If True, display controls to shut down the Jupyter server, such as menu items or buttons.""",
14361434
)
14371435

1438-
# REMOVE in VERSION 2.0
1439-
# Temporarily allow content managers to inherit from the 'notebook'
1440-
# package. We will deprecate this in the next major release.
1441-
contents_manager_class = TypeFromClasses(
1442-
default_value=LargeFileManager,
1443-
klasses=[
1444-
"jupyter_server.services.contents.manager.ContentsManager",
1445-
"notebook.services.contents.manager.ContentsManager",
1446-
],
1436+
contents_manager_class = Type(
1437+
default_value=AsyncLargeFileManager,
1438+
klass=ContentsManager,
14471439
config=True,
14481440
help=_i18n("The content manager class to use."),
14491441
)
14501442

1451-
# Throws a deprecation warning to notebook based contents managers.
1452-
@observe("contents_manager_class")
1453-
def _observe_contents_manager_class(self, change):
1454-
new = change["new"]
1455-
# If 'new' is a class, get a string representing the import
1456-
# module path.
1457-
if inspect.isclass(new):
1458-
new = new.__module__
1459-
1460-
if new.startswith("notebook"):
1461-
self.log.warning(
1462-
"The specified 'contents_manager_class' class inherits a manager from the "
1463-
"'notebook' package. This is not guaranteed to work in future "
1464-
"releases of Jupyter Server. Instead, consider switching the "
1465-
"manager to inherit from the 'jupyter_server' managers. "
1466-
"Jupyter Server will temporarily allow 'notebook' managers "
1467-
"until its next major release (2.x)."
1468-
)
1469-
14701443
kernel_manager_class = Type(
14711444
klass=MappingKernelManager,
14721445
config=True,
@@ -1823,6 +1796,20 @@ def init_configurables(self):
18231796
# this determination, instantiate the GatewayClient config singleton.
18241797
self.gateway_config = GatewayClient.instance(parent=self)
18251798

1799+
if not issubclass(self.kernel_manager_class, AsyncMappingKernelManager):
1800+
warnings.warn(
1801+
"The synchronous MappingKernelManager class is deprecated and will not be supported in Jupyter Server 3.0",
1802+
DeprecationWarning,
1803+
stacklevel=2,
1804+
)
1805+
1806+
if not issubclass(self.contents_manager_class, AsyncContentsManager):
1807+
warnings.warn(
1808+
"The synchronous ContentsManager classes are deprecated and will not be supported in Jupyter Server 3.0",
1809+
DeprecationWarning,
1810+
stacklevel=2,
1811+
)
1812+
18261813
self.kernel_spec_manager = self.kernel_spec_manager_class(
18271814
parent=self,
18281815
)

jupyter_server/services/contents/filemanager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ async def save(self, model, path=""):
774774
"""Save the file model and return the model with no content."""
775775
path = path.strip("/")
776776

777-
self.run_pre_save_hook(model=model, path=path)
777+
self.run_pre_save_hooks(model=model, path=path)
778778

779779
if "type" not in model:
780780
raise web.HTTPError(400, "No file type provided")

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ dependencies = [
3030
"anyio>=3.1.0,<4",
3131
"argon2-cffi",
3232
"jinja2",
33-
"jupyter_client>=7.2",
33+
"jupyter_client>=7.4.4",
3434
"jupyter_core>=4.9.2",
3535
"jupyter_server_terminals",
3636
"nbconvert>=6.4.4",
3737
"nbformat>=5.2.0",
3838
"packaging",
3939
"prometheus_client",
4040
"pywinpty;os_name=='nt'",
41-
"pyzmq>=17",
41+
"pyzmq>=24",
4242
"Send2Trash",
4343
"terminado>=0.8.3",
44-
"tornado>=6.1.0",
44+
"tornado>=6.2.0",
4545
"traitlets>=5.1",
4646
"websocket-client",
4747
"jupyter_events>=0.4.0"
@@ -141,7 +141,7 @@ filterwarnings = [
141141
"error",
142142
"ignore:Passing a schema to Validator.iter_errors:DeprecationWarning",
143143
"ignore:run_pre_save_hook is deprecated:DeprecationWarning",
144-
144+
"always:unclosed <socket.socket:ResourceWarning",
145145
"module:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning",
146146
]
147147

0 commit comments

Comments
 (0)