Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
29a8019
Fixed error accessing sys.stdout/sys.stderr when those are None (#1247)
gregory-shklover Jul 1, 2024
eff15cf
Detect parent change in more cases on unix (#1271)
bluss Oct 15, 2024
0efd83e
Try to add workflow to publish nightlies (#1276)
Carreau Oct 22, 2024
3274845
install build
Carreau Oct 22, 2024
1c14e83
Remove some potential dead-code. (#1273)
Carreau Oct 22, 2024
1990ff5
remove deprecated ipyparallel methods
minrk Oct 22, 2024
1bc2277
update test_should_handle
minrk Oct 22, 2024
22632d7
update control channel message type comment
minrk Oct 25, 2024
c775910
Add 20 min timeout dowstream ipyparallel (#1287)
Carreau Oct 28, 2024
9f82d32
Fix test_print_to_correct_cell_from_child_thread (#1312)
davidbrochart Dec 20, 2024
70a5848
Remove dead code (#1332)
Carreau Feb 13, 2025
5afd989
Remove link to numfocus for funding. (#1320)
Carreau Feb 12, 2025
c190cf6
minor code reformating valid ruff 0.9.6 (#1330)
Carreau Feb 13, 2025
5b3a84b
Copy payloadpage.page from IPython (#1317)
Carreau Feb 13, 2025
4ddb547
Try to force precommit-ci to send autoupdate PRs. (#1325)
Carreau Feb 13, 2025
6162765
make debugger class configurable (#1307)
smacke Feb 14, 2025
76dbe37
Remove downstream_check (#1318)
Carreau Feb 14, 2025
9b653d9
Remove implicit bind_kernel in `%qtconsole` (#1315)
minrk Feb 14, 2025
665dd2c
Use supported_features=['debugger'] in kernel info reply (#1296)
ianthomas23 Feb 14, 2025
148afd6
Some formatting changes to prepare bumping ruff pre-commit. (#1329)
Carreau Feb 14, 2025
8cde51d
Ignore or fix most of the remaining ruff 0.9.6 errors (#1331)
Carreau Feb 14, 2025
1939a5a
Suggest to make implementations of some function always return awaita…
Carreau Feb 17, 2025
2695ae9
Enable ruff G002 and fix 6 occurences (#1341)
Carreau Feb 18, 2025
9930732
Remove unused ignores lints. (#1342)
Carreau Feb 18, 2025
2c7cf9d
Refine deprecation error messages. (#1334)
Carreau Feb 19, 2025
dc45243
Try to debug non-closed iopub socket (#1345)
Carreau Feb 19, 2025
9af3995
Make our own mock kernel methods async (#1346)
Carreau Feb 19, 2025
f16220b
Try to reenable tests from downstream ipywidgets (#1350)
Carreau Feb 20, 2025
1f1cd44
Check ignores warnings are still relevant. (#1340)
Carreau Feb 20, 2025
e5f1dfc
Remove deprecated modules since 4.3 (2016). (#1352)
Carreau Feb 28, 2025
9c9fbc6
Fix OutStream using _fid before being defined (#1373)
davidbrochart Mar 6, 2025
50d4db0
TQDM workaround due to unresponsive maintainer (#1363)
Carreau Mar 21, 2025
524040a
chore: update pre-commit hooks (#1388)
pre-commit-ci[bot] Apr 8, 2025
558859c
Bump mypy to 1.16.1
ianthomas23 Jul 14, 2025
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
20 changes: 2 additions & 18 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/downstream-test@v1
with:
package_name: ipywidgets
test_command: pytest -vv -raXxs -k \"not deprecation_fa_icons and not tooltip_deprecation and not on_submit_deprecation\" -W default --durations 10 --color=yes
test_command: pytest -vv -raXxs -W default --durations 10 --color=yes

jupyter_client:
runs-on: ubuntu-latest
Expand All @@ -56,6 +56,7 @@ jobs:

ipyparallel:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -147,20 +148,3 @@ jobs:
run: |
cd ${GITHUB_WORKSPACE}/../spyder-kernels
xvfb-run --auto-servernum ${pythonLocation}/bin/python -m pytest -x -vv -s --full-trace --color=yes spyder_kernels

downstream_check: # This job does nothing and is only used for the branch protection
if: always()
needs:
- nbclient
- ipywidgets
- jupyter_client
- ipyparallel
- jupyter_kernel_test
- spyder_kernels
- qtconsole
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
33 changes: 33 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: nightly build and upload
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

defaults:
run:
shell: bash -eux {0}

jobs:
build:
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Build
run: |
python -m pip install build
python -m build
- name: Upload wheel
uses: scientific-python/upload-nightly-action@82396a2ed4269ba06c6b2988bb4fd568ef3c3d6b # 0.6.1
with:
artifacts_path: dist
anaconda_nightly_upload_token: ${{secrets.UPLOAD_TOKEN}}
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ci:
autoupdate_schedule: monthly
autoupdate_commit_msg: "chore: update pre-commit hooks"
autoupdate_schedule: weekly

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down Expand Up @@ -40,7 +40,7 @@ repos:
types_or: [yaml, html, json]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.8.0"
rev: "v1.16.1"
hooks:
- id: mypy
files: ipykernel
Expand Down Expand Up @@ -74,7 +74,7 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
rev: v0.11.4
hooks:
- id: ruff
types_or: [python, jupyter]
Expand Down
35 changes: 3 additions & 32 deletions examples/embedding/inprocess_qtconsole.py
Original file line number Diff line number Diff line change
@@ -1,54 +1,25 @@
"""An in-process qt console app."""

import os
import sys

import tornado
from IPython.lib import guisupport
from qtconsole.inprocess import QtInProcessKernelManager
from qtconsole.rich_ipython_widget import RichIPythonWidget

assert tornado.version_info >= (6, 1)


def print_process_id():
"""Print the process id."""
print("Process ID is:", os.getpid())


def init_asyncio_patch():
"""set default asyncio policy to be compatible with tornado
Tornado 6 (at least) is not compatible with the default
asyncio implementation on Windows
Pick the older SelectorEventLoopPolicy on Windows
if the known-incompatible default policy is in use.
do this as early as possible to make it a low priority and overridable
ref: https://github.com/tornadoweb/tornado/issues/2608
FIXME: if/when tornado supports the defaults in asyncio,
remove and bump tornado requirement for py38
"""
if (
sys.platform.startswith("win")
and sys.version_info >= (3, 8)
and tornado.version_info < (6, 1)
):
import asyncio

try:
from asyncio import WindowsProactorEventLoopPolicy, WindowsSelectorEventLoopPolicy
except ImportError:
pass
# not affected
else:
if type(asyncio.get_event_loop_policy()) is WindowsProactorEventLoopPolicy:
# WindowsProactorEventLoopPolicy is not compatible with tornado 6
# fallback to the pre-3.8 default of Selector
asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())


def main():
"""The main entry point."""
# Print the ID of the main process
print_process_id()

init_asyncio_patch()
app = guisupport.get_app_qt4()

# Create an in-process kernel
Expand Down
1 change: 1 addition & 0 deletions examples/embedding/inprocess_terminal.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""An in-process terminal example."""

import os
import sys

Expand Down
1 change: 1 addition & 0 deletions examples/embedding/ipkernel_wxapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

Ref: Modified from wxPython source code wxPython/samples/simple/simple.py
"""

# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions hatch_build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A custom hatch build hook for ipykernel."""

import shutil
import sys
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions ipykernel/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The cli entry point for ipykernel."""

if __name__ == "__main__":
from ipykernel import kernelapp as app

Expand Down
1 change: 1 addition & 0 deletions ipykernel/_version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
store the current version info of the server.
"""

import re

# Version string must appear intact for hatch versioning
Expand Down
2 changes: 1 addition & 1 deletion ipykernel/comm/comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def publish_msg(self, msg_type, data=None, metadata=None, buffers=None, **keys):
class Comm(BaseComm, traitlets.config.LoggingConfigurable):
"""Class for communicating between a Frontend and a Kernel"""

kernel = Instance("ipykernel.kernelbase.Kernel", allow_none=True) # type:ignore[assignment]
kernel = Instance("ipykernel.kernelbase.Kernel", allow_none=True)
comm_id = Unicode()
primary = Bool(True, help="Am I the primary or secondary Comm?")

Expand Down
1 change: 1 addition & 0 deletions ipykernel/compiler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Compiler helpers for the debugger."""

import os
import sys
import tempfile
Expand Down
8 changes: 4 additions & 4 deletions ipykernel/connect.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Connection file-related utilities for the kernel
"""
"""Connection file-related utilities for the kernel"""

# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations
Expand Down Expand Up @@ -133,8 +133,8 @@ def connect_qtconsole(


__all__ = [
"write_connection_file",
"connect_qtconsole",
"get_connection_file",
"get_connection_info",
"connect_qtconsole",
"write_connection_file",
]
84 changes: 0 additions & 84 deletions ipykernel/datapub.py

This file was deleted.

1 change: 1 addition & 0 deletions ipykernel/debugger.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Debugger implementation for the IPython kernel."""

import os
import re
import sys
Expand Down
3 changes: 1 addition & 2 deletions ipykernel/embed.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Simple function for embedding an IPython kernel
"""
"""Simple function for embedding an IPython kernel"""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions ipykernel/gui/gtk3embed.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""GUI support for the IPython ZeroMQ kernel - GTK toolkit support.
"""
"""GUI support for the IPython ZeroMQ kernel - GTK toolkit support."""
# -----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
Expand Down
3 changes: 1 addition & 2 deletions ipykernel/gui/gtkembed.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""GUI support for the IPython ZeroMQ kernel - GTK toolkit support.
"""
"""GUI support for the IPython ZeroMQ kernel - GTK toolkit support."""
# -----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
Expand Down
3 changes: 1 addition & 2 deletions ipykernel/heartbeat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""The client and server for a basic ping-pong style heartbeat.
"""
"""The client and server for a basic ping-pong style heartbeat."""

# -----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
Expand Down
10 changes: 6 additions & 4 deletions ipykernel/inprocess/blocking.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
""" Implements a fully blocking kernel client.
"""Implements a fully blocking kernel client.

Useful for test suites and blocking terminal interfaces.
"""

import sys

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -68,6 +69,7 @@ def call_handlers(self, msg):
_raw_input = self.client.kernel._sys_raw_input
prompt = msg["content"]["prompt"]
print(prompt, end="", file=sys.__stdout__)
assert sys.__stdout__ is not None
sys.__stdout__.flush()
self.client.input(_raw_input())

Expand All @@ -76,9 +78,9 @@ class BlockingInProcessKernelClient(InProcessKernelClient):
"""A blocking in-process kernel client."""

# The classes to use for the various channels.
shell_channel_class = Type(BlockingInProcessChannel) # type:ignore[arg-type]
iopub_channel_class = Type(BlockingInProcessChannel) # type:ignore[arg-type]
stdin_channel_class = Type(BlockingInProcessStdInChannel) # type:ignore[arg-type]
shell_channel_class = Type(BlockingInProcessChannel)
iopub_channel_class = Type(BlockingInProcessChannel)
stdin_channel_class = Type(BlockingInProcessStdInChannel)

def wait_for_ready(self):
"""Wait for kernel info reply on shell channel."""
Expand Down
Loading
Loading