Skip to content

Commit 5b8ac29

Browse files
authored
Drop support for Python 3.9 (#1431)
1 parent 39d4c74 commit 5b8ac29

File tree

7 files changed

+15
-13
lines changed

7 files changed

+15
-13
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
matrix:
2424
os: [ubuntu-latest, windows-latest, macos-latest]
2525
python-version:
26-
- "3.9"
2726
- "3.10"
2827
- "3.11"
2928
- "3.12"
@@ -122,7 +121,7 @@ jobs:
122121
fail-fast: false
123122
matrix:
124123
os: [ubuntu-latest]
125-
python-version: ["3.9"]
124+
python-version: ["3.10"]
126125
steps:
127126
- name: Checkout
128127
uses: actions/checkout@v5
@@ -153,7 +152,7 @@ jobs:
153152
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
154153
with:
155154
dependency_type: minimum
156-
python_version: "3.9"
155+
python_version: "3.10"
157156

158157
- name: List installed packages
159158
run: |

.github/workflows/downstream.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,15 @@ jobs:
9090
9191
qtconsole:
9292
runs-on: ubuntu-latest
93+
if: false
9394
timeout-minutes: 20
9495
steps:
9596
- name: Checkout
9697
uses: actions/checkout@v5
9798
- name: Setup Python
9899
uses: actions/setup-python@v6
99100
with:
100-
python-version: "3.9"
101+
python-version: "3.10"
101102
architecture: "x64"
102103
- name: Install System Packages
103104
run: |
@@ -122,14 +123,15 @@ jobs:
122123
123124
spyder_kernels:
124125
runs-on: ubuntu-latest
126+
if: false
125127
timeout-minutes: 20
126128
steps:
127129
- name: Checkout
128130
uses: actions/checkout@v5
129131
- name: Setup Python
130132
uses: actions/setup-python@v6
131133
with:
132-
python-version: "3.9"
134+
python-version: "3.10"
133135
architecture: "x64"
134136
- name: Install System Packages
135137
run: |

ipykernel/iostream.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
import warnings
1515
from binascii import b2a_hex
1616
from collections import defaultdict, deque
17+
from collections.abc import Callable
1718
from io import StringIO, TextIOBase
1819
from threading import local
19-
from typing import Any, Callable, Optional
20+
from typing import Any
2021

2122
import zmq
2223
from jupyter_client.session import extract_header
@@ -70,7 +71,7 @@ def __init__(self, socket, pipe=False):
7071
self._event_pipes: dict[threading.Thread, Any] = {}
7172
self._event_pipe_gc_lock: threading.Lock = threading.Lock()
7273
self._event_pipe_gc_seconds: float = 10
73-
self._event_pipe_gc_task: Optional[asyncio.Task[Any]] = None
74+
self._event_pipe_gc_task: asyncio.Task[Any] | None = None
7475
self._setup_event_pipe()
7576
self.thread = threading.Thread(target=self._thread_main, name="IOPub")
7677
self.thread.daemon = True
@@ -359,7 +360,7 @@ class OutStream(TextIOBase):
359360
flush_interval = 0.2
360361
topic = None
361362
encoding = "UTF-8"
362-
_exc: Optional[Any] = None
363+
_exc: Any | None = None
363364

364365
def fileno(self):
365366
"""
@@ -658,7 +659,7 @@ def _flush(self):
658659
ident=self.topic,
659660
)
660661

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

ipykernel/jsonutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def json_clean(obj): # pragma: no cover
156156
for k, v in obj.items():
157157
out[str(k)] = json_clean(v)
158158
return out
159-
if isinstance(obj, (datetime, date)):
159+
if isinstance(obj, datetime | date):
160160
return obj.strftime(ISO8601)
161161

162162
# we don't understand it, it's probably an unserializable object

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ classifiers = [
1717
"Programming Language :: Python",
1818
"Programming Language :: Python :: 3",
1919
]
20-
requires-python = ">=3.9"
20+
requires-python = ">=3.10"
2121
dependencies = [
2222
"debugpy>=1.6.5",
2323
"ipython>=7.23.1",

tests/test_kernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ def ensure_datetime(arg):
634634

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

tests/test_subshells.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def test_run_concurrently_sequence(are_subshells, overlap, request):
164164
]
165165

166166
msgs = []
167-
for subshell_id, code in zip(subshell_ids, codes):
167+
for subshell_id, code in zip(subshell_ids, codes, strict=False):
168168
msg = kc.session.msg("execute_request", {"code": code})
169169
msg["header"]["subshell_id"] = subshell_id
170170
kc.shell_channel.send(msg)

0 commit comments

Comments
 (0)