Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
Expand Down Expand Up @@ -122,7 +121,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.9"]
python-version: ["3.10"]
steps:
- name: Checkout
uses: actions/checkout@v5
Expand Down Expand Up @@ -153,7 +152,7 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
with:
dependency_type: minimum
python_version: "3.9"
python_version: "3.10"

- name: List installed packages
run: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,15 @@ jobs:

qtconsole:
runs-on: ubuntu-latest
if: false
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.9"
python-version: "3.10"
architecture: "x64"
- name: Install System Packages
run: |
Expand All @@ -122,14 +123,15 @@ jobs:

spyder_kernels:
runs-on: ubuntu-latest
if: false
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.9"
python-version: "3.10"
architecture: "x64"
- name: Install System Packages
run: |
Expand Down
9 changes: 5 additions & 4 deletions ipykernel/iostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
import warnings
from binascii import b2a_hex
from collections import defaultdict, deque
from collections.abc import Callable
from io import StringIO, TextIOBase
from threading import local
from typing import Any, Callable, Optional
from typing import Any

import zmq
from jupyter_client.session import extract_header
Expand Down Expand Up @@ -70,7 +71,7 @@ def __init__(self, socket, pipe=False):
self._event_pipes: dict[threading.Thread, Any] = {}
self._event_pipe_gc_lock: threading.Lock = threading.Lock()
self._event_pipe_gc_seconds: float = 10
self._event_pipe_gc_task: Optional[asyncio.Task[Any]] = None
self._event_pipe_gc_task: asyncio.Task[Any] | None = None
self._setup_event_pipe()
self.thread = threading.Thread(target=self._thread_main, name="IOPub")
self.thread.daemon = True
Expand Down Expand Up @@ -359,7 +360,7 @@ class OutStream(TextIOBase):
flush_interval = 0.2
topic = None
encoding = "UTF-8"
_exc: Optional[Any] = None
_exc: Any | None = None

def fileno(self):
"""
Expand Down Expand Up @@ -658,7 +659,7 @@ def _flush(self):
ident=self.topic,
)

def write(self, string: str) -> Optional[int]: # type:ignore[override]
def write(self, string: str) -> int | None: # type:ignore[override]
"""Write to current stream after encoding if necessary

Returns
Expand Down
2 changes: 1 addition & 1 deletion ipykernel/jsonutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def json_clean(obj): # pragma: no cover
for k, v in obj.items():
out[str(k)] = json_clean(v)
return out
if isinstance(obj, (datetime, date)):
if isinstance(obj, datetime | date):
return obj.strftime(ISO8601)

# we don't understand it, it's probably an unserializable object
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
]
requires-python = ">=3.9"
requires-python = ">=3.10"
dependencies = [
"debugpy>=1.6.5",
"ipython>=7.23.1",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ def ensure_datetime(arg):

# Check messages are processed in order, one at a time, and of a sensible duration.
previous_end = None
for reply, sleep in zip(replies, sleeps):
for reply, sleep in zip(replies, sleeps, strict=False):
start = ensure_datetime(reply["metadata"]["started"])
end = ensure_datetime(reply["header"]["date"])

Expand Down
2 changes: 1 addition & 1 deletion tests/test_subshells.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def test_run_concurrently_sequence(are_subshells, overlap, request):
]

msgs = []
for subshell_id, code in zip(subshell_ids, codes):
for subshell_id, code in zip(subshell_ids, codes, strict=False):
msg = kc.session.msg("execute_request", {"code": code})
msg["header"]["subshell_id"] = subshell_id
kc.shell_channel.send(msg)
Expand Down
Loading