-
Notifications
You must be signed in to change notification settings - Fork 2.5k
python3-ipython_ipykernel: update deps and patch for python 3.13 #53642
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
42d9ca2
hatchling: update to 1.27.0.
tornaria 36d5956
python3-pytest-asyncio: update to 0.25.0.
tornaria 318eed7
python3-tornado: update to 6.4.2.
tornaria 35269a4
python3-jupyter_client: update to 8.6.3.
tornaria edf1c41
python3-ipython_ipykernel: patch for python 3.13
tornaria File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| Taken from https://github.com/ipython/ipykernel/pull/1248 | ||
|
|
||
| From 3e7fb7c787511212ccb642004b4331a59594a329 Mon Sep 17 00:00:00 2001 | ||
| From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <[email protected]> | ||
| Date: Mon, 10 Jun 2024 16:11:33 +0200 | ||
| Subject: [PATCH] Avoid a DeprecationWarning on Python 3.13+ | ||
|
|
||
| ... | ||
| /usr/lib/python3.13/site-packages/ipykernel/jsonutil.py:29: in <module> | ||
| datetime.strptime("1", "%d") | ||
| /usr/lib64/python3.13/_strptime.py:573: in _strptime_datetime | ||
| tt, fraction, gmtoff_fraction = _strptime(data_string, format) | ||
| /usr/lib64/python3.13/_strptime.py:336: in _strptime | ||
| format_regex = _TimeRE_cache.compile(format) | ||
| /usr/lib64/python3.13/_strptime.py:282: in compile | ||
| return re_compile(self.pattern(format), IGNORECASE) | ||
| /usr/lib64/python3.13/_strptime.py:270: in pattern | ||
| warnings.warn("""\ | ||
| E DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious | ||
| E and fails to parse leap day. The default behavior will change in Python 3.15 | ||
| E to either always raise an exception or to use a different default year (TBD). | ||
| E To avoid trouble, add a specific year to the input & format. | ||
| E See https://github.com/python/cpython/issues/70647. | ||
|
|
||
| See also https://github.com/jupyter/jupyter_client/issues/1020 | ||
| --- | ||
| ipykernel/jsonutil.py | 2 +- | ||
| 1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
|
||
| diff --git a/ipykernel/jsonutil.py b/ipykernel/jsonutil.py | ||
| index 6a463cf1..e45f06e5 100644 | ||
| --- a/ipykernel/jsonutil.py | ||
| +++ b/ipykernel/jsonutil.py | ||
| @@ -26,7 +26,7 @@ | ||
|
|
||
| # holy crap, strptime is not threadsafe. | ||
| # Calling it once at import seems to help. | ||
| -datetime.strptime("1", "%d") | ||
| +datetime.strptime("2000-01-01", "%Y-%m-%d") | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # Classes and functions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,238 @@ | ||
| Backported to 6.29.5 from https://github.com/ipython/ipykernel/pull/1277 | ||
| See https://github.com/ipython/ipykernel/issues/1302 | ||
|
|
||
| diff --git a/docs/conf.py b/docs/conf.py | ||
| index 4bb59932..38a724b5 100644 | ||
| --- a/docs/conf.py | ||
| +++ b/docs/conf.py | ||
| @@ -13,7 +13,7 @@ | ||
| import os | ||
| import shutil | ||
| from pathlib import Path | ||
| -from typing import Any, Dict, List | ||
| +from typing import Any | ||
|
|
||
| # If extensions (or modules to document with autodoc) are in another directory, | ||
| # add these directories to sys.path here. If the directory is relative to the | ||
| @@ -70,7 +70,7 @@ | ||
| # built documents. | ||
| # | ||
|
|
||
| -version_ns: Dict[str, Any] = {} | ||
| +version_ns: dict[str, Any] = {} | ||
| here = Path(__file__).parent.resolve() | ||
| version_py = Path(here) / os.pardir / "ipykernel" / "_version.py" | ||
| with open(version_py) as f: | ||
| @@ -159,7 +159,7 @@ | ||
| # Add any paths that contain custom static files (such as style sheets) here, | ||
| # relative to this directory. They are copied after the builtin static files, | ||
| # so a file named "default.css" will overwrite the builtin "default.css". | ||
| -html_static_path: List[str] = [] | ||
| +html_static_path: list[str] = [] | ||
|
|
||
| # Add any extra paths that contain custom files (such as robots.txt or | ||
| # .htaccess) here, relative to this directory. These files are copied | ||
| @@ -226,7 +226,7 @@ | ||
|
|
||
| # -- Options for LaTeX output --------------------------------------------- | ||
|
|
||
| -latex_elements: Dict[str, object] = {} | ||
| +latex_elements: dict[str, object] = {} | ||
|
|
||
| # Grouping the document tree into LaTeX files. List of tuples | ||
| # (source start file, target name, title, | ||
| diff --git a/ipykernel/_version.py b/ipykernel/_version.py | ||
| index d9a9f534..5907d150 100644 | ||
| --- a/ipykernel/_version.py | ||
| +++ b/ipykernel/_version.py | ||
| @@ -2,7 +2,6 @@ | ||
| store the current version info of the server. | ||
| """ | ||
| import re | ||
| -from typing import List | ||
|
|
||
| # Version string must appear intact for hatch versioning | ||
| __version__ = "7.0.0a0" | ||
| @@ -11,7 +10,7 @@ | ||
| pattern = r"(?P<major>\d+).(?P<minor>\d+).(?P<patch>\d+)(?P<rest>.*)" | ||
| match = re.match(pattern, __version__) | ||
| assert match is not None | ||
| -parts: List[object] = [int(match[part]) for part in ["major", "minor", "patch"]] | ||
| +parts: list[object] = [int(match[part]) for part in ["major", "minor", "patch"]] | ||
| if match["rest"]: | ||
| parts.append(match["rest"]) | ||
| version_info = tuple(parts) | ||
| diff --git a/ipykernel/debugger.py b/ipykernel/debugger.py | ||
| index 8680793f..780d1801 100644 | ||
| --- a/ipykernel/debugger.py | ||
| +++ b/ipykernel/debugger.py | ||
| @@ -130,7 +130,7 @@ def _reset_tcp_pos(self): | ||
|
|
||
| def _put_message(self, raw_msg): | ||
| self.log.debug("QUEUE - _put_message:") | ||
| - msg = t.cast(t.Dict[str, t.Any], jsonapi.loads(raw_msg)) | ||
| + msg = t.cast(dict[str, t.Any], jsonapi.loads(raw_msg)) | ||
| if msg["type"] == "event": | ||
| self.log.debug("QUEUE - received event:") | ||
| self.log.debug(msg) | ||
| diff --git a/ipykernel/inprocess/channels.py b/ipykernel/inprocess/channels.py | ||
| index 378416dc..4c01c5bc 100644 | ||
| --- a/ipykernel/inprocess/channels.py | ||
| +++ b/ipykernel/inprocess/channels.py | ||
| @@ -3,8 +3,6 @@ | ||
| # Copyright (c) IPython Development Team. | ||
| # Distributed under the terms of the Modified BSD License. | ||
|
|
||
| -from typing import List | ||
| - | ||
| from jupyter_client.channelsabc import HBChannelABC | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| @@ -15,7 +13,7 @@ | ||
| class InProcessChannel: | ||
| """Base class for in-process channels.""" | ||
|
|
||
| - proxy_methods: List[object] = [] | ||
| + proxy_methods: list[object] = [] | ||
|
|
||
| def __init__(self, client=None): | ||
| """Initialize the channel.""" | ||
| diff --git a/ipykernel/iostream.py b/ipykernel/iostream.py | ||
| index beca44b1..81170b97 100644 | ||
| --- a/ipykernel/iostream.py | ||
| +++ b/ipykernel/iostream.py | ||
| @@ -15,7 +15,7 @@ | ||
| from collections import defaultdict, deque | ||
| from io import StringIO, TextIOBase | ||
| from threading import local | ||
| -from typing import Any, Callable, Deque, Dict, Optional | ||
| +from typing import Any, Callable, Optional | ||
|
|
||
| import zmq | ||
| from jupyter_client.session import extract_header | ||
| @@ -94,8 +94,8 @@ def __init__(self, socket, pipe=False): | ||
| if pipe: | ||
| self._setup_pipe_in() | ||
| self._local = threading.local() | ||
| - self._events: Deque[Callable[..., Any]] = deque() | ||
| - self._event_pipes: Dict[threading.Thread, Any] = {} | ||
| + self._events: deque[Callable[..., Any]] = deque() | ||
| + self._event_pipes: dict[threading.Thread, Any] = {} | ||
| self._event_pipe_gc_lock: threading.Lock = threading.Lock() | ||
| self._event_pipe_gc_seconds: float = 10 | ||
| self._setup_event_pipe() | ||
| @@ -470,7 +470,7 @@ def __init__( | ||
| self.pub_thread = pub_thread | ||
| self.name = name | ||
| self.topic = b"stream." + name.encode() | ||
| - self._parent_header: contextvars.ContextVar[Dict[str, Any]] = contextvars.ContextVar( | ||
| + self._parent_header: contextvars.ContextVar[dict[str, Any]] = contextvars.ContextVar( | ||
| "parent_header" | ||
| ) | ||
| self._parent_header.set({}) | ||
| diff --git a/ipykernel/ipkernel.py b/ipykernel/ipkernel.py | ||
| index db83d986..48efa6cd 100644 | ||
| --- a/ipykernel/ipkernel.py | ||
| +++ b/ipykernel/ipkernel.py | ||
| @@ -1,5 +1,7 @@ | ||
| """The IPython kernel implementation""" | ||
|
|
||
| +from __future__ import annotations | ||
| + | ||
| import asyncio | ||
| import builtins | ||
| import gc | ||
| @@ -16,7 +18,7 @@ | ||
| from IPython.core import release | ||
| from IPython.utils.tokenutil import line_at_cursor, token_at_cursor | ||
| from jupyter_client.session import extract_header | ||
| -from traitlets import Any, Bool, HasTraits, Instance, List, Type, observe, observe_compat | ||
| +from traitlets import Any, Bool, HasTraits, Instance, List, Type, default, observe, observe_compat | ||
| from zmq.eventloop.zmqstream import ZMQStream | ||
|
|
||
| from .comm.comm import BaseComm | ||
| @@ -46,7 +48,7 @@ def _create_comm(*args, **kwargs): | ||
|
|
||
| # there can only be one comm manager in a ipykernel process | ||
| _comm_lock = threading.Lock() | ||
| -_comm_manager: t.Optional[CommManager] = None | ||
| +_comm_manager: CommManager | None = None | ||
|
|
||
|
|
||
| def _get_comm_manager(*args, **kwargs): | ||
| @@ -84,7 +86,11 @@ def _user_module_changed(self, change): | ||
| if self.shell is not None: | ||
| self.shell.user_module = change["new"] | ||
|
|
||
| - user_ns = Instance(dict, args=None, allow_none=True) | ||
| + user_ns = Instance("collections.abc.Mapping", allow_none=True) | ||
| + | ||
| + @default("user_ns") | ||
| + def _default_user_ns(self): | ||
| + return dict() | ||
|
|
||
| @observe("user_ns") | ||
| @observe_compat | ||
| @@ -353,7 +359,7 @@ async def do_execute( | ||
|
|
||
| self._forward_input(allow_stdin) | ||
|
|
||
| - reply_content: t.Dict[str, t.Any] = {} | ||
| + reply_content: dict[str, t.Any] = {} | ||
| if hasattr(shell, "run_cell_async") and hasattr(shell, "should_run_async"): | ||
| run_cell = shell.run_cell_async | ||
| should_run_async = shell.should_run_async | ||
| @@ -559,7 +565,7 @@ def do_inspect(self, code, cursor_pos, detail_level=0, omit_sections=()): | ||
| """Handle code inspection.""" | ||
| name = token_at_cursor(code, cursor_pos) | ||
|
|
||
| - reply_content: t.Dict[str, t.Any] = {"status": "ok"} | ||
| + reply_content: dict[str, t.Any] = {"status": "ok"} | ||
| reply_content["data"] = {} | ||
| reply_content["metadata"] = {} | ||
| assert self.shell is not None | ||
| @@ -755,7 +761,7 @@ def init_closure(self: threading.Thread, *args, **kwargs): | ||
| threading.Thread.run = run_closure # type:ignore[method-assign] | ||
|
|
||
| def _clean_thread_parent_frames( | ||
| - self, phase: t.Literal["start", "stop"], info: t.Dict[str, t.Any] | ||
| + self, phase: t.Literal["start", "stop"], info: dict[str, t.Any] | ||
| ): | ||
| """Clean parent frames of threads which are no longer running. | ||
| This is meant to be invoked by garbage collector callback hook. | ||
| diff --git a/ipykernel/pickleutil.py b/ipykernel/pickleutil.py | ||
| index 6f156594..4ffa5262 100644 | ||
| --- a/ipykernel/pickleutil.py | ||
| +++ b/ipykernel/pickleutil.py | ||
| @@ -209,7 +209,7 @@ def __init__(self, f): | ||
| """Initialize the can""" | ||
| self._check_type(f) | ||
| self.code = f.__code__ | ||
| - self.defaults: typing.Optional[typing.List[typing.Any]] | ||
| + self.defaults: typing.Optional[list[typing.Any]] | ||
| if f.__defaults__: | ||
| self.defaults = [can(fd) for fd in f.__defaults__] | ||
| else: | ||
| @@ -475,7 +475,7 @@ def uncan_sequence(obj, g=None): | ||
| if buffer is not memoryview: | ||
| can_map[buffer] = CannedBuffer | ||
|
|
||
| -uncan_map: typing.Dict[type, typing.Any] = { | ||
| +uncan_map: dict[type, typing.Any] = { | ||
| CannedObject: lambda obj, g: obj.get_object(g), | ||
| dict: uncan_dict, | ||
| } | ||
| diff --git a/pyproject.toml b/pyproject.toml | ||
| index 1e9e543c..e1d7b1d5 100644 | ||
| --- a/pyproject.toml | ||
| +++ b/pyproject.toml | ||
| @@ -187,6 +187,9 @@ filterwarnings= [ | ||
|
|
||
| # Ignore datetime warning. | ||
| "ignore:datetime.datetime.utc:DeprecationWarning", | ||
| + | ||
| + # ignore unclosed sqlite in traits | ||
| + "ignore:unclosed database in <sqlite3.Connection:ResourceWarning", | ||
| ] | ||
|
|
||
| [tool.coverage.report] |
15 changes: 15 additions & 0 deletions
15
srcpkgs/python3-ipython_ipykernel/patches/disable-debugpy.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| Upstream acks that ipykernel works without debugpy, but wants to keep | ||
| it as a mandatory dependency, see: | ||
|
|
||
| https://github.com/ipython/ipykernel/pull/767#issuecomment-916913893 | ||
|
|
||
| --- a/pyproject.toml 2020-02-01 21:00:00.000000000 -0300 | ||
| +++ b/pyproject.toml 2024-12-23 10:53:39.607541653 -0300 | ||
| @@ -20,7 +20,6 @@ | ||
| ] | ||
| requires-python = ">=3.8" | ||
| dependencies = [ | ||
| - "debugpy>=1.6.5", | ||
| "ipython>=7.23.1", | ||
| "comm>=0.1.1", | ||
| "traitlets>=5.4.0", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,28 @@ | ||
| # Template file for 'python3-jupyter_client' | ||
| pkgname=python3-jupyter_client | ||
| version=8.6.2 | ||
| revision=2 | ||
| version=8.6.3 | ||
| revision=1 | ||
| build_style=python3-pep517 | ||
| # 1st: random fail (see https://github.com/jupyter/jupyter_client/issues/979) | ||
| # 2nd: fail by timeout in ~ 60s | ||
| # random failures (see https://github.com/jupyter/jupyter_client/issues/979) | ||
| make_check_args=" | ||
| --deselect tests/test_kernelmanager.py::TestParallel::test_start_parallel_process_kernels[tcp] | ||
| --deselect tests/test_restarter.py::test_restart_check[ipc]" | ||
| --deselect tests/test_kernelmanager.py::TestParallel::test_start_sequence_kernels[ipc] | ||
| --deselect tests/test_kernelmanager.py::TestParallel::test_start_sequence_process_kernels[tcp] | ||
| --deselect tests/test_restarter.py::test_restart_check[ipc] | ||
| --deselect tests/test_restarter.py::test_async_restart_check[ipc] | ||
| --deselect tests/test_client.py::TestAsyncKernelClient::test_input_request" | ||
| hostmakedepends="hatchling" | ||
| depends="python3-dateutil python3-jupyter_core python3-pyzmq python3-tornado" | ||
| checkdepends="$depends inetutils-ifconfig iproute2 openssh | ||
| depends="python3-dateutil python3-jupyter_core python3-pyzmq python3-tornado | ||
| python3-traitlets" | ||
| checkdepends="$depends inetutils-ifconfig iproute2 openssh python3-msgpack | ||
| python3-pytest-jupyter python3-pytest-timeout python3-pytest-xdist" | ||
| short_desc="Jupyter protocol client APIs" | ||
| maintainer="Gonzalo Tornaría <[email protected]>" | ||
| license="BSD-3-Clause" | ||
| homepage="https://github.com/jupyter/jupyter_client" | ||
| changelog="https://raw.githubusercontent.com/jupyter/jupyter_client/main/CHANGELOG.md" | ||
| distfiles="${PYPI_SITE}/j/jupyter_client/jupyter_client-${version}.tar.gz" | ||
| checksum=2bda14d55ee5ba58552a8c53ae43d215ad9868853489213f37da060ced54d8df | ||
| checksum=35b3a0947c4a6e9d589eb97d7d4cd5e90f910ee73101611f01283732bd6d9419 | ||
| conflicts="python-jupyter_client<=5.2.4_2" | ||
| make_check=extended # cannot be tested without python3-ipython_ipykernel | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.