Skip to content

Stop support for Python 3.9 #1316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.13"]
python-version: ["3.10", "3.13"]
include:
- os: ubuntu-latest
python-version: "pypy-3.9"
python-version: "pypy-3.10"
- os: macos-latest
python-version: "3.10"
- os: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion ipykernel/iostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,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 Event, Thread, local
from typing import Any, Callable
from typing import Any

import zmq
from anyio import create_task_group, run, sleep, to_thread
Expand Down
5 changes: 1 addition & 4 deletions ipykernel/ipkernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,7 @@ def __init__(self, **kwargs):
self._new_threads_parent_header = {}
self._initialize_thread_hooks()

if hasattr(gc, "callbacks"):
# while `gc.callbacks` exists since Python 3.3, pypy does not
# implement it even as of 3.9.
gc.callbacks.append(self._clean_thread_parent_frames)
gc.callbacks.append(self._clean_thread_parent_frames)

help_links = List(
[
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
]
requires-python = ">=3.9"
requires-python = ">=3.10"
dependencies = [
"debugpy>=1.8.1",
"ipython>=7.23.1",
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import asyncio
import logging
import os
from collections.abc import Callable
from math import inf
from typing import Any, Callable, no_type_check
from typing import Any, no_type_check
from unittest.mock import MagicMock

import pytest
Expand Down
2 changes: 1 addition & 1 deletion tests/test_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,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
8 changes: 5 additions & 3 deletions tests/test_subshells.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def test_run_concurrently_sequence(are_subshells, overlap):
]

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 Expand Up @@ -191,7 +191,7 @@ def test_run_concurrently_timing(include_main_shell):
# Identical times for both subshells is a harder test as preparing and sending
# the execute_reply messages may overlap.
msgs = []
for id, sleep in zip(subshell_ids, times):
for id, sleep in zip(subshell_ids, times, strict=False):
code = f"b.wait(); time.sleep({sleep})"
msg = kc.session.msg("execute_request", {"code": code})
msg["header"]["subshell_id"] = id
Expand Down Expand Up @@ -231,7 +231,9 @@ def test_execution_count():
# Prepare messages
times = (0.2, 0.1, 0.4, 0.15) # Sleep seconds
msgs = []
for i, (id, sleep) in enumerate(zip((None, subshell_id, None, subshell_id), times)):
for i, (id, sleep) in enumerate(
zip((None, subshell_id, None, subshell_id), times, strict=False)
):
code = f"b.wait(); time.sleep({sleep})" if i < 2 else f"time.sleep({sleep})"
msg = kc.session.msg("execute_request", {"code": code})
msg["header"]["subshell_id"] = id
Expand Down
Loading