txl-remote-kernels 0.1.14__py3-none-any.whl → 0.1.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of txl-remote-kernels might be problematic. Click here for more details.
- txl_remote_kernels/__init__.py +1 -1
- txl_remote_kernels/driver.py +21 -19
- {txl_remote_kernels-0.1.14.dist-info → txl_remote_kernels-0.1.16.dist-info}/METADATA +1 -1
- txl_remote_kernels-0.1.16.dist-info/RECORD +9 -0
- {txl_remote_kernels-0.1.14.dist-info → txl_remote_kernels-0.1.16.dist-info}/WHEEL +1 -1
- txl_remote_kernels-0.1.14.dist-info/RECORD +0 -9
- {txl_remote_kernels-0.1.14.dist-info → txl_remote_kernels-0.1.16.dist-info}/entry_points.txt +0 -0
- {txl_remote_kernels-0.1.14.dist-info → txl_remote_kernels-0.1.16.dist-info}/licenses/LICENSE.txt +0 -0
txl_remote_kernels/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.16"
|
txl_remote_kernels/driver.py
CHANGED
|
@@ -44,6 +44,7 @@ class KernelDriver(KernelMixin):
|
|
|
44
44
|
self.shell_channel = "shell"
|
|
45
45
|
self.control_channel = "control"
|
|
46
46
|
self.iopub_channel = "iopub"
|
|
47
|
+
self.send_lock = asyncio.Lock()
|
|
47
48
|
|
|
48
49
|
async def start(self):
|
|
49
50
|
i = str(uuid.uuid4())
|
|
@@ -60,15 +61,15 @@ class KernelDriver(KernelMixin):
|
|
|
60
61
|
params={**self.query_params},
|
|
61
62
|
cookies=self.cookies,
|
|
62
63
|
)
|
|
63
|
-
|
|
64
|
+
d = r.json()
|
|
64
65
|
self.cookies.update(r.cookies)
|
|
65
|
-
self.session_id =
|
|
66
|
-
kernel_id =
|
|
67
|
-
|
|
66
|
+
self.session_id = d["id"]
|
|
67
|
+
kernel_id = d["kernel"]["id"]
|
|
68
|
+
r = await client.get(
|
|
68
69
|
f"{self.base_url}/api/kernels/{kernel_id}",
|
|
69
70
|
cookies=self.cookies,
|
|
70
71
|
)
|
|
71
|
-
if
|
|
72
|
+
if r.status_code != 200 or kernel_id != r.json()["id"]:
|
|
72
73
|
return
|
|
73
74
|
async with aconnect_ws(
|
|
74
75
|
f"{self.ws_url}/api/kernels/{kernel_id}/channels",
|
|
@@ -103,18 +104,19 @@ class KernelDriver(KernelMixin):
|
|
|
103
104
|
channel,
|
|
104
105
|
change_date_to_str: bool = False,
|
|
105
106
|
):
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
else:
|
|
116
|
-
bmsg = to_binary(msg)
|
|
117
|
-
if bmsg is None:
|
|
118
|
-
await self.websocket.send_json(msg)
|
|
119
|
-
else:
|
|
107
|
+
async with self.send_lock:
|
|
108
|
+
_date_to_str = date_to_str if change_date_to_str else lambda x: x
|
|
109
|
+
msg["header"] = _date_to_str(msg["header"])
|
|
110
|
+
msg["parent_header"] = _date_to_str(msg["parent_header"])
|
|
111
|
+
msg["metadata"] = _date_to_str(msg["metadata"])
|
|
112
|
+
msg["content"] = _date_to_str(msg.get("content", {}))
|
|
113
|
+
msg["channel"] = channel
|
|
114
|
+
if self.websocket.subprotocol == "v1.kernel.websocket.jupyter.org":
|
|
115
|
+
bmsg = serialize_msg_to_ws_v1(msg)
|
|
120
116
|
await self.websocket.send_bytes(bmsg)
|
|
117
|
+
else:
|
|
118
|
+
bmsg = to_binary(msg)
|
|
119
|
+
if bmsg is None:
|
|
120
|
+
await self.websocket.send_json(msg)
|
|
121
|
+
else:
|
|
122
|
+
await self.websocket.send_bytes(bmsg)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: txl_remote_kernels
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.16
|
|
4
4
|
Summary: TXL plugin for remote kernels
|
|
5
5
|
Project-URL: Source, https://github.com/davidbrochart/jpterm/plugins/remote_kernels
|
|
6
6
|
Author-email: David Brochart <david.brochart@gmail.com>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
txl_remote_kernels/__init__.py,sha256=yF88-8vL8keLe6gCTumymw0UoMkWkSrJnzLru4zBCLQ,23
|
|
2
|
+
txl_remote_kernels/components.py,sha256=ZLBD7Ho_vC-FKAWDmE8AGkuZ9c7_PvIXFSB8XEUkI7A,921
|
|
3
|
+
txl_remote_kernels/driver.py,sha256=G__2Kuy98TdAhMDId4M-kWwAYtZJI4uG5PRuiILZD5k,4179
|
|
4
|
+
txl_remote_kernels/message.py,sha256=MggdtjyBuSscUlNRW_uiVUsDwb8UD-tPK0Mt7Sfstww,2422
|
|
5
|
+
txl_remote_kernels-0.1.16.dist-info/METADATA,sha256=l2bPjmpO5udvxglcF9R4K3Zn8XhKnoihewdX8loiKDw,853
|
|
6
|
+
txl_remote_kernels-0.1.16.dist-info/WHEEL,sha256=9QBuHhg6FNW7lppboF2vKVbCGTVzsFykgRQjjlajrhA,87
|
|
7
|
+
txl_remote_kernels-0.1.16.dist-info/entry_points.txt,sha256=stPbh3WGBIcvL3GmKAj0bh22My10JeciqiQjHjkdaPs,91
|
|
8
|
+
txl_remote_kernels-0.1.16.dist-info/licenses/LICENSE.txt,sha256=su0IgzSHZ9tMFeCQ_IaCji5Q4VrZSOqDsEFi7lPduc8,1106
|
|
9
|
+
txl_remote_kernels-0.1.16.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
txl_remote_kernels/__init__.py,sha256=PIBqEOI-nqKFL9oJAWQQwlHuujG9Cd7EmdxDrThNQto,23
|
|
2
|
-
txl_remote_kernels/components.py,sha256=ZLBD7Ho_vC-FKAWDmE8AGkuZ9c7_PvIXFSB8XEUkI7A,921
|
|
3
|
-
txl_remote_kernels/driver.py,sha256=vZqAQCSgixkbqWy2gH6GCM4nzWEPL1xbuC8UkDJ08FE,4086
|
|
4
|
-
txl_remote_kernels/message.py,sha256=MggdtjyBuSscUlNRW_uiVUsDwb8UD-tPK0Mt7Sfstww,2422
|
|
5
|
-
txl_remote_kernels-0.1.14.dist-info/METADATA,sha256=ud0gej2ZIaxQbfzk91r8r762rKRt7NeL7--IwOVwOIk,853
|
|
6
|
-
txl_remote_kernels-0.1.14.dist-info/WHEEL,sha256=y1bSCq4r5i4nMmpXeUJMqs3ipKvkZObrIXSvJHm1qCI,87
|
|
7
|
-
txl_remote_kernels-0.1.14.dist-info/entry_points.txt,sha256=stPbh3WGBIcvL3GmKAj0bh22My10JeciqiQjHjkdaPs,91
|
|
8
|
-
txl_remote_kernels-0.1.14.dist-info/licenses/LICENSE.txt,sha256=su0IgzSHZ9tMFeCQ_IaCji5Q4VrZSOqDsEFi7lPduc8,1106
|
|
9
|
-
txl_remote_kernels-0.1.14.dist-info/RECORD,,
|
{txl_remote_kernels-0.1.14.dist-info → txl_remote_kernels-0.1.16.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{txl_remote_kernels-0.1.14.dist-info → txl_remote_kernels-0.1.16.dist-info}/licenses/LICENSE.txt
RENAMED
|
File without changes
|