Skip to content

Commit c1e4834

Browse files
committed
Merge remote-tracking branch 'origin/main' into thread-tasks
2 parents 2ab1933 + f8e7b8e commit c1e4834

19 files changed

+151
-97
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44

55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.5.0
7+
rev: v5.0.0
88
hooks:
99
- id: check-case-conflict
1010
- id: check-ast
@@ -22,12 +22,12 @@ repos:
2222
- id: trailing-whitespace
2323

2424
- repo: https://github.com/python-jsonschema/check-jsonschema
25-
rev: 0.27.4
25+
rev: 0.31.1
2626
hooks:
2727
- id: check-github-workflows
2828

2929
- repo: https://github.com/executablebooks/mdformat
30-
rev: 0.7.17
30+
rev: 0.7.22
3131
hooks:
3232
- id: mdformat
3333
additional_dependencies:
@@ -55,13 +55,13 @@ repos:
5555
]
5656

5757
- repo: https://github.com/adamchainz/blacken-docs
58-
rev: "1.16.0"
58+
rev: "1.19.1"
5959
hooks:
6060
- id: blacken-docs
6161
additional_dependencies: [black==23.7.0]
6262

6363
- repo: https://github.com/codespell-project/codespell
64-
rev: "v2.2.6"
64+
rev: "v2.4.1"
6565
hooks:
6666
- id: codespell
6767
args: ["-L", "sur,nd"]

CHANGELOG.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
### Maintenance and upkeep improvements
6161

62-
- \[6.x\] Update Release Scripts [#1251](https://github.com/ipython/ipykernel/pull/1251) ([@blink1073](https://github.com/blink1073))
62+
- [6.x] Update Release Scripts [#1251](https://github.com/ipython/ipykernel/pull/1251) ([@blink1073](https://github.com/blink1073))
6363

6464
### Contributors to this release
6565

@@ -118,7 +118,7 @@
118118

119119
### Bugs fixed
120120

121-
- Fix: ipykernel_launcher, delete absolute sys.path\[0\] [#1206](https://github.com/ipython/ipykernel/pull/1206) ([@stdll00](https://github.com/stdll00))
121+
- Fix: ipykernel_launcher, delete absolute sys.path[0] [#1206](https://github.com/ipython/ipykernel/pull/1206) ([@stdll00](https://github.com/stdll00))
122122

123123
### Maintenance and upkeep improvements
124124

@@ -386,7 +386,7 @@
386386

387387
### Enhancements made
388388

389-
- Support control\<>iopub messages to e.g. unblock comm_msg from command execution [#1114](https://github.com/ipython/ipykernel/pull/1114) ([@tkrabel-db](https://github.com/tkrabel-db))
389+
- Support control\<>iopub messages to e.g. unblock comm_msg from command execution [#1114](https://github.com/ipython/ipykernel/pull/1114) ([@tkrabel-db](https://github.com/tkrabel-db))
390390
- Add outstream hook similar to display publisher [#1110](https://github.com/ipython/ipykernel/pull/1110) ([@maartenbreddels](https://github.com/maartenbreddels))
391391

392392
### Maintenance and upkeep improvements
@@ -796,10 +796,10 @@
796796

797797
### Maintenance and upkeep improvements
798798

799-
- \[pre-commit.ci\] pre-commit autoupdate [#989](https://github.com/ipython/ipykernel/pull/989) ([@pre-commit-ci](https://github.com/pre-commit-ci))
800-
- \[pre-commit.ci\] pre-commit autoupdate [#985](https://github.com/ipython/ipykernel/pull/985) ([@pre-commit-ci](https://github.com/pre-commit-ci))
799+
- [pre-commit.ci] pre-commit autoupdate [#989](https://github.com/ipython/ipykernel/pull/989) ([@pre-commit-ci](https://github.com/pre-commit-ci))
800+
- [pre-commit.ci] pre-commit autoupdate [#985](https://github.com/ipython/ipykernel/pull/985) ([@pre-commit-ci](https://github.com/pre-commit-ci))
801801
- Add python logo in svg format [#984](https://github.com/ipython/ipykernel/pull/984) ([@steff456](https://github.com/steff456))
802-
- \[pre-commit.ci\] pre-commit autoupdate [#982](https://github.com/ipython/ipykernel/pull/982) ([@pre-commit-ci](https://github.com/pre-commit-ci))
802+
- [pre-commit.ci] pre-commit autoupdate [#982](https://github.com/ipython/ipykernel/pull/982) ([@pre-commit-ci](https://github.com/pre-commit-ci))
803803

804804
### Contributors to this release
805805

@@ -817,13 +817,13 @@
817817

818818
### Maintenance and upkeep improvements
819819

820-
- \[pre-commit.ci\] pre-commit autoupdate [#978](https://github.com/ipython/ipykernel/pull/978) ([@pre-commit-ci](https://github.com/pre-commit-ci))
821-
- \[pre-commit.ci\] pre-commit autoupdate [#977](https://github.com/ipython/ipykernel/pull/977) ([@pre-commit-ci](https://github.com/pre-commit-ci))
822-
- \[pre-commit.ci\] pre-commit autoupdate [#976](https://github.com/ipython/ipykernel/pull/976) ([@pre-commit-ci](https://github.com/pre-commit-ci))
823-
- \[pre-commit.ci\] pre-commit autoupdate [#974](https://github.com/ipython/ipykernel/pull/974) ([@pre-commit-ci](https://github.com/pre-commit-ci))
824-
- \[pre-commit.ci\] pre-commit autoupdate [#971](https://github.com/ipython/ipykernel/pull/971) ([@pre-commit-ci](https://github.com/pre-commit-ci))
825-
- \[pre-commit.ci\] pre-commit autoupdate [#968](https://github.com/ipython/ipykernel/pull/968) ([@pre-commit-ci](https://github.com/pre-commit-ci))
826-
- \[pre-commit.ci\] pre-commit autoupdate [#966](https://github.com/ipython/ipykernel/pull/966) ([@pre-commit-ci](https://github.com/pre-commit-ci))
820+
- [pre-commit.ci] pre-commit autoupdate [#978](https://github.com/ipython/ipykernel/pull/978) ([@pre-commit-ci](https://github.com/pre-commit-ci))
821+
- [pre-commit.ci] pre-commit autoupdate [#977](https://github.com/ipython/ipykernel/pull/977) ([@pre-commit-ci](https://github.com/pre-commit-ci))
822+
- [pre-commit.ci] pre-commit autoupdate [#976](https://github.com/ipython/ipykernel/pull/976) ([@pre-commit-ci](https://github.com/pre-commit-ci))
823+
- [pre-commit.ci] pre-commit autoupdate [#974](https://github.com/ipython/ipykernel/pull/974) ([@pre-commit-ci](https://github.com/pre-commit-ci))
824+
- [pre-commit.ci] pre-commit autoupdate [#971](https://github.com/ipython/ipykernel/pull/971) ([@pre-commit-ci](https://github.com/pre-commit-ci))
825+
- [pre-commit.ci] pre-commit autoupdate [#968](https://github.com/ipython/ipykernel/pull/968) ([@pre-commit-ci](https://github.com/pre-commit-ci))
826+
- [pre-commit.ci] pre-commit autoupdate [#966](https://github.com/ipython/ipykernel/pull/966) ([@pre-commit-ci](https://github.com/pre-commit-ci))
827827

828828
### Contributors to this release
829829

@@ -841,9 +841,9 @@
841841

842842
### Maintenance and upkeep improvements
843843

844-
- \[pre-commit.ci\] pre-commit autoupdate [#962](https://github.com/ipython/ipykernel/pull/962) ([@pre-commit-ci](https://github.com/pre-commit-ci))
845-
- \[pre-commit.ci\] pre-commit autoupdate [#961](https://github.com/ipython/ipykernel/pull/961) ([@pre-commit-ci](https://github.com/pre-commit-ci))
846-
- \[pre-commit.ci\] pre-commit autoupdate [#960](https://github.com/ipython/ipykernel/pull/960) ([@pre-commit-ci](https://github.com/pre-commit-ci))
844+
- [pre-commit.ci] pre-commit autoupdate [#962](https://github.com/ipython/ipykernel/pull/962) ([@pre-commit-ci](https://github.com/pre-commit-ci))
845+
- [pre-commit.ci] pre-commit autoupdate [#961](https://github.com/ipython/ipykernel/pull/961) ([@pre-commit-ci](https://github.com/pre-commit-ci))
846+
- [pre-commit.ci] pre-commit autoupdate [#960](https://github.com/ipython/ipykernel/pull/960) ([@pre-commit-ci](https://github.com/pre-commit-ci))
847847

848848
### Contributors to this release
849849

@@ -863,7 +863,7 @@
863863

864864
- Back to top-level tornado IOLoop [#958](https://github.com/ipython/ipykernel/pull/958) ([@minrk](https://github.com/minrk))
865865
- Explicitly require pyzmq >= 17 [#957](https://github.com/ipython/ipykernel/pull/957) ([@minrk](https://github.com/minrk))
866-
- \[pre-commit.ci\] pre-commit autoupdate [#954](https://github.com/ipython/ipykernel/pull/954) ([@pre-commit-ci](https://github.com/pre-commit-ci))
866+
- [pre-commit.ci] pre-commit autoupdate [#954](https://github.com/ipython/ipykernel/pull/954) ([@pre-commit-ci](https://github.com/pre-commit-ci))
867867

868868
### Contributors to this release
869869

@@ -887,7 +887,7 @@
887887
### Maintenance and upkeep improvements
888888

889889
- Fix sphinx 5.0 support [#951](https://github.com/ipython/ipykernel/pull/951) ([@blink1073](https://github.com/blink1073))
890-
- \[pre-commit.ci\] pre-commit autoupdate [#950](https://github.com/ipython/ipykernel/pull/950) ([@pre-commit-ci](https://github.com/pre-commit-ci))
890+
- [pre-commit.ci] pre-commit autoupdate [#950](https://github.com/ipython/ipykernel/pull/950) ([@pre-commit-ci](https://github.com/pre-commit-ci))
891891

892892
### Contributors to this release
893893

@@ -906,18 +906,18 @@
906906

907907
### Maintenance and upkeep improvements
908908

909-
- \[pre-commit.ci\] pre-commit autoupdate [#945](https://github.com/ipython/ipykernel/pull/945) ([@pre-commit-ci](https://github.com/pre-commit-ci))
909+
- [pre-commit.ci] pre-commit autoupdate [#945](https://github.com/ipython/ipykernel/pull/945) ([@pre-commit-ci](https://github.com/pre-commit-ci))
910910
- Clean up typings [#939](https://github.com/ipython/ipykernel/pull/939) ([@blink1073](https://github.com/blink1073))
911-
- \[pre-commit.ci\] pre-commit autoupdate [#938](https://github.com/ipython/ipykernel/pull/938) ([@pre-commit-ci](https://github.com/pre-commit-ci))
911+
- [pre-commit.ci] pre-commit autoupdate [#938](https://github.com/ipython/ipykernel/pull/938) ([@pre-commit-ci](https://github.com/pre-commit-ci))
912912
- Clean up types [#933](https://github.com/ipython/ipykernel/pull/933) ([@blink1073](https://github.com/blink1073))
913-
- \[pre-commit.ci\] pre-commit autoupdate [#932](https://github.com/ipython/ipykernel/pull/932) ([@pre-commit-ci](https://github.com/pre-commit-ci))
913+
- [pre-commit.ci] pre-commit autoupdate [#932](https://github.com/ipython/ipykernel/pull/932) ([@pre-commit-ci](https://github.com/pre-commit-ci))
914914
- Switch to hatch backend [#931](https://github.com/ipython/ipykernel/pull/931) ([@blink1073](https://github.com/blink1073))
915-
- \[pre-commit.ci\] pre-commit autoupdate [#928](https://github.com/ipython/ipykernel/pull/928) ([@pre-commit-ci](https://github.com/pre-commit-ci))
916-
- \[pre-commit.ci\] pre-commit autoupdate [#926](https://github.com/ipython/ipykernel/pull/926) ([@pre-commit-ci](https://github.com/pre-commit-ci))
915+
- [pre-commit.ci] pre-commit autoupdate [#928](https://github.com/ipython/ipykernel/pull/928) ([@pre-commit-ci](https://github.com/pre-commit-ci))
916+
- [pre-commit.ci] pre-commit autoupdate [#926](https://github.com/ipython/ipykernel/pull/926) ([@pre-commit-ci](https://github.com/pre-commit-ci))
917917
- Allow enforce PR label workflow to add labels [#921](https://github.com/ipython/ipykernel/pull/921) ([@blink1073](https://github.com/blink1073))
918-
- \[pre-commit.ci\] pre-commit autoupdate [#920](https://github.com/ipython/ipykernel/pull/920) ([@pre-commit-ci](https://github.com/pre-commit-ci))
919-
- \[pre-commit.ci\] pre-commit autoupdate [#919](https://github.com/ipython/ipykernel/pull/919) ([@pre-commit-ci](https://github.com/pre-commit-ci))
920-
- \[pre-commit.ci\] pre-commit autoupdate [#917](https://github.com/ipython/ipykernel/pull/917) ([@pre-commit-ci](https://github.com/pre-commit-ci))
918+
- [pre-commit.ci] pre-commit autoupdate [#920](https://github.com/ipython/ipykernel/pull/920) ([@pre-commit-ci](https://github.com/pre-commit-ci))
919+
- [pre-commit.ci] pre-commit autoupdate [#919](https://github.com/ipython/ipykernel/pull/919) ([@pre-commit-ci](https://github.com/pre-commit-ci))
920+
- [pre-commit.ci] pre-commit autoupdate [#917](https://github.com/ipython/ipykernel/pull/917) ([@pre-commit-ci](https://github.com/pre-commit-ci))
921921

922922
### Contributors to this release
923923

@@ -942,7 +942,7 @@
942942
- Add basic mypy support [#913](https://github.com/ipython/ipykernel/pull/913) ([@blink1073](https://github.com/blink1073))
943943
- Clean up pre-commit [#911](https://github.com/ipython/ipykernel/pull/911) ([@blink1073](https://github.com/blink1073))
944944
- Update setup.py [#909](https://github.com/ipython/ipykernel/pull/909) ([@tlinhart](https://github.com/tlinhart))
945-
- \[pre-commit.ci\] pre-commit autoupdate [#906](https://github.com/ipython/ipykernel/pull/906) ([@pre-commit-ci](https://github.com/pre-commit-ci))
945+
- [pre-commit.ci] pre-commit autoupdate [#906](https://github.com/ipython/ipykernel/pull/906) ([@pre-commit-ci](https://github.com/pre-commit-ci))
946946

947947
### Contributors to this release
948948

@@ -1360,7 +1360,7 @@
13601360

13611361
- Add watchfd keyword to InProcessKernel OutStream initialization [#727](https://github.com/ipython/ipykernel/pull/727) ([@rayosborn](https://github.com/rayosborn))
13621362
- Fix typo in eventloops.py [#711](https://github.com/ipython/ipykernel/pull/711) ([@selasley](https://github.com/selasley))
1363-
- \[bugfix\] fix in setup.py (comma before appnope) [#709](https://github.com/ipython/ipykernel/pull/709) ([@jstriebel](https://github.com/jstriebel))
1363+
- [bugfix] fix in setup.py (comma before appnope) [#709](https://github.com/ipython/ipykernel/pull/709) ([@jstriebel](https://github.com/jstriebel))
13641364

13651365
### Maintenance and upkeep improvements
13661366

ipykernel/_version.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""
22
store the current version info of the server.
33
"""
4+
from __future__ import annotations
5+
46
import re
57

68
# Version string must appear intact for hatch versioning

ipykernel/connect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ def connect_qtconsole(
133133

134134

135135
__all__ = [
136-
"write_connection_file",
136+
"connect_qtconsole",
137137
"get_connection_file",
138138
"get_connection_info",
139-
"connect_qtconsole",
139+
"write_connection_file",
140140
]

ipykernel/embed.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ def embed_kernel(module=None, local_ns=None, **kwargs):
5555
app.kernel.user_ns = local_ns
5656
app.shell.set_completer_frame() # type:ignore[union-attr]
5757
app.start()
58+
app.close()

ipykernel/inprocess/channels.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Copyright (c) IPython Development Team.
44
# Distributed under the terms of the Modified BSD License.
5+
from __future__ import annotations
56

67
from jupyter_client.channelsabc import HBChannelABC
78

ipykernel/iostream.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,8 @@ def fileno(self):
370370
"""
371371
Things like subprocess will peak and write to the fileno() of stderr/stdout.
372372
"""
373-
if getattr(self, "_original_stdstream_copy", None) is not None:
374-
return self._original_stdstream_copy
373+
if getattr(self, "_original_stdstream_fd", None) is not None:
374+
return self._original_stdstream_fd
375375
msg = "fileno"
376376
raise io.UnsupportedOperation(msg)
377377

@@ -473,11 +473,13 @@ def __init__(
473473
self._local = local()
474474

475475
if (
476-
watchfd
477-
and (
478-
(sys.platform.startswith("linux") or sys.platform.startswith("darwin"))
479-
# Pytest set its own capture. Don't redirect from within pytest.
480-
and ("PYTEST_CURRENT_TEST" not in os.environ)
476+
(
477+
watchfd
478+
and (
479+
(sys.platform.startswith("linux") or sys.platform.startswith("darwin"))
480+
# Pytest set its own capture. Don't redirect from within pytest.
481+
and ("PYTEST_CURRENT_TEST" not in os.environ)
482+
)
481483
)
482484
# allow forcing watchfd (mainly for tests)
483485
or watchfd == "force"
@@ -499,10 +501,7 @@ def __init__(
499501
# echo on the _copy_ we made during
500502
# this is the actual terminal FD now
501503
echo = io.TextIOWrapper(
502-
io.FileIO(
503-
self._original_stdstream_copy,
504-
"w",
505-
)
504+
io.FileIO(self._original_stdstream_copy, "w", closefd=False)
506505
)
507506
self.echo = echo
508507
else:
@@ -567,9 +566,10 @@ def close(self):
567566
self._should_watch = False
568567
# thread won't wake unless there's something to read
569568
# writing something after _should_watch will not be echoed
570-
os.write(self._original_stdstream_fd, b"\0")
571-
if self.watch_fd_thread is not None:
569+
if self.watch_fd_thread is not None and self.watch_fd_thread.is_alive():
570+
os.write(self._original_stdstream_fd, b"\0")
572571
self.watch_fd_thread.join()
572+
self.echo = None
573573
# restore original FDs
574574
os.dup2(self._original_stdstream_copy, self._original_stdstream_fd)
575575
os.close(self._original_stdstream_copy)

0 commit comments

Comments
 (0)