Skip to content

Commit 115a973

Browse files
authored
Merge branch 'jupyter-server:main' into cors_files
2 parents d75bf80 + 952782b commit 115a973

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+858
-163
lines changed

.github/workflows/python-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
os: [ubuntu-latest, windows-latest, macos-latest]
21-
python-version: ["3.8", "3.11"]
21+
python-version: ["3.9", "3.11", "3.12"]
2222
include:
2323
- os: windows-latest
2424
python-version: "3.9"
2525
- os: ubuntu-latest
26-
python-version: "pypy-3.8"
26+
python-version: "pypy-3.9"
2727
- os: macos-latest
2828
python-version: "3.10"
2929
- os: ubuntu-latest
@@ -180,7 +180,7 @@ jobs:
180180
fail-fast: false
181181
matrix:
182182
os: [ubuntu-latest]
183-
python-version: ["3.8", "3.9", "3.10", "3.11"]
183+
python-version: ["3.9", "3.10", "3.11", "3.12"]
184184
steps:
185185
- uses: actions/checkout@v4
186186
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
@@ -194,7 +194,7 @@ jobs:
194194
- uses: actions/checkout@v4
195195
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
196196
with:
197-
python_version: "pypy-3.8"
197+
python_version: "pypy-3.9"
198198
- name: Run the tests
199199
run: hatch -v run test:nowarn --integration_tests=true
200200

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ repos:
2121
- id: trailing-whitespace
2222

2323
- repo: https://github.com/python-jsonschema/check-jsonschema
24-
rev: 0.28.4
24+
rev: 0.28.6
2525
hooks:
2626
- id: check-github-workflows
2727

@@ -52,7 +52,7 @@ repos:
5252
- id: rst-inline-touching-normal
5353

5454
- repo: https://github.com/pre-commit/mirrors-mypy
55-
rev: "v1.10.0"
55+
rev: "v1.10.1"
5656
hooks:
5757
- id: mypy
5858
files: jupyter_server
@@ -61,7 +61,7 @@ repos:
6161
["traitlets>=5.13", "jupyter_core>=5.5", "jupyter_client>=8.5"]
6262

6363
- repo: https://github.com/astral-sh/ruff-pre-commit
64-
rev: v0.4.7
64+
rev: v0.5.0
6565
hooks:
6666
- id: ruff
6767
types_or: [python, jupyter]

CHANGELOG.md

Lines changed: 124 additions & 2 deletions
Large diffs are not rendered by default.

examples/simple/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ build-backend = "hatchling.build"
66
name = "jupyter-server-example"
77
description = "Jupyter Server Example"
88
readme = "README.md"
9-
license = ""
10-
requires-python = ">=3.8"
9+
license = "MIT"
10+
requires-python = ">=3.9"
1111
dependencies = [
1212
"jinja2",
1313
"jupyter_server",

examples/simple/simple_ext1/handlers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def get(self):
1818
self.log.info(f"Extension Name in {self.name} Default Handler: {self.name}")
1919
# A method for getting the url to static files (prefixed with /static/<name>).
2020
self.log.info(
21-
"Static URL for / in simple_ext1 Default Handler: {}".format(self.static_url(path="/"))
21+
"Static URL for / in simple_ext1 Default Handler: %s",
22+
self.static_url(path="/"),
2223
)
2324
self.write("<h1>Hello Simple 1 - I am the default...</h1>")
2425
self.write(f"Config in {self.name} Default Handler: {self.config}")

jupyter_server/_version.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44
"""
55

66
import re
7-
from typing import List
87

98
# Version string must appear intact for automatic versioning
10-
__version__ = "2.15.0.dev0"
9+
__version__ = "2.16.0.dev0"
1110

1211
# Build up version_info tuple for backwards compatibility
1312
pattern = r"(?P<major>\d+).(?P<minor>\d+).(?P<patch>\d+)(?P<rest>.*)"
1413
match = re.match(pattern, __version__)
1514
assert match is not None
16-
parts: List[object] = [int(match[part]) for part in ["major", "minor", "patch"]]
15+
parts: list[object] = [int(match[part]) for part in ["major", "minor", "patch"]]
1716
if match["rest"]:
1817
parts.append(match["rest"])
1918
version_info = tuple(parts)

jupyter_server/auth/authorizer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
# Distributed under the terms of the Modified BSD License.
1111
from __future__ import annotations
1212

13-
from typing import TYPE_CHECKING, Awaitable
13+
from typing import TYPE_CHECKING
1414

1515
from traitlets import Instance
1616
from traitlets.config import LoggingConfigurable
1717

1818
from .identity import IdentityProvider, User
1919

2020
if TYPE_CHECKING:
21+
from collections.abc import Awaitable
22+
2123
from jupyter_server.base.handlers import JupyterHandler
2224

2325

jupyter_server/base/call_context.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Distributed under the terms of the Modified BSD License.
44

55
from contextvars import Context, ContextVar, copy_context
6-
from typing import Any, Dict, List
6+
from typing import Any
77

88

99
class CallContext:
@@ -22,7 +22,7 @@ class CallContext:
2222
# easier management over maintaining a set of ContextVar instances, since the Context is a
2323
# map of ContextVar instances to their values, and the "name" is no longer a lookup key.
2424
_NAME_VALUE_MAP = "_name_value_map"
25-
_name_value_map: ContextVar[Dict[str, Any]] = ContextVar(_NAME_VALUE_MAP)
25+
_name_value_map: ContextVar[dict[str, Any]] = ContextVar(_NAME_VALUE_MAP)
2626

2727
@classmethod
2828
def get(cls, name: str) -> Any:
@@ -65,7 +65,7 @@ def set(cls, name: str, value: Any) -> None:
6565
name_value_map[name] = value
6666

6767
@classmethod
68-
def context_variable_names(cls) -> List[str]:
68+
def context_variable_names(cls) -> list[str]:
6969
"""Returns a list of variable names set for this call context.
7070
7171
Returns
@@ -77,7 +77,7 @@ def context_variable_names(cls) -> List[str]:
7777
return list(name_value_map.keys())
7878

7979
@classmethod
80-
def _get_map(cls) -> Dict[str, Any]:
80+
def _get_map(cls) -> dict[str, Any]:
8181
"""Get the map of names to their values from the _NAME_VALUE_MAP context var.
8282
8383
If the map does not exist in the current context, an empty map is created and returned.

jupyter_server/base/handlers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
import re
1414
import types
1515
import warnings
16+
from collections.abc import Awaitable, Coroutine, Sequence
1617
from http.client import responses
1718
from logging import Logger
18-
from typing import TYPE_CHECKING, Any, Awaitable, Coroutine, Sequence, cast
19+
from typing import TYPE_CHECKING, Any, cast
1920
from urllib.parse import urlparse
2021

2122
import prometheus_client

jupyter_server/config_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from traitlets.config import LoggingConfigurable
1515
from traitlets.traitlets import Bool, Unicode
1616

17-
StrDict = t.Dict[str, t.Any]
17+
StrDict = dict[str, t.Any]
1818

1919

2020
def recursive_update(target: StrDict, new: StrDict) -> None:

0 commit comments

Comments
 (0)