Repository navigation
Fix kernel lifecycle with warnings treated as errors - #1583
JackyHsu-X wants to merge 3 commits into
Conversation
|
The minimum-dependency failure occurs before the new cases reach the kernel lifecycle checks: jupyter_core 5.1.0 emits its platformdirs migration warning during import, and the child interpreters deliberately use warnings-as-errors. The follow-up opts these two test functions into the documented Validation:
The remaining label gate requires a triage label such as OpenAI Codex prepared and ran this investigation, revision and validation; no independent human review is claimed. |
|
I merged upstream main at On Windows, the four related test modules reported 42 passed and 11 skipped. Ruff lint and format checks passed for the conflict resolution file. Commit: |
|
The updated CI run has one test failure on macOS / Qt5 / PyPy 3.11: test_run_concurrently_sequence[True-are_subshells0] timed out while waiting for shell replies. The log also shows a KeyError: 'quit' in one reply. The other five parameter combinations passed. On the same upstream base commit 7940a09, the corresponding macOS / Qt5 / PyPy job passed on November 22, while an earlier Ubuntu / Qt5 / PyPy run timed out in a different subshell test. This suggests subshell tests may be timing-sensitive, but does not establish the cause of this failure or rule out an interaction with this PR. Could a maintainer rerun the failed ipykernel tests job? I tried, but GitHub reports that repository admin rights are required. The separate label check also needs a triage label. |
Fixes #1582.
Prepare the main thread's event loop before starting the kernel. Handle Python 3.12's implicit-loop deprecation by explicitly creating a loop, while preserving an existing loop. Make
IPythonKernel.do_shutdown()async, matching the base class and avoiding its synchronous-hook warning.Seven regression cases cover unset, cleared and preconfigured loops, both shutdown restart flags, and real stock-launcher startup, execution, shutdown replies and clean process exits with warnings-as-errors. The subprocess cases explicitly opt into
JUPYTER_PLATFORM_DIRS=1so jupyter_core 5.1.0's unrelated path-migration warning does not terminate imports. Their strict warning policy remains enabled.Validation:
No production code changed in the minimum-dependency follow-up. No dependency, lockfile or CI changes. The full platform/Python/GUI matrix was not run locally, and remote CI must run on the revised head. The separate triage-label gate needs a maintainer.
AI disclosure: OpenAI Codex generated the changes and ran the investigation and validation. No independent human review is claimed.