txl_remote_kernels 0.3.7__tar.gz → 0.3.8__tar.gz

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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: txl_remote_kernels
3
- Version: 0.3.7
3
+ Version: 0.3.8
4
4
  Summary: TXL plugin for remote kernels
5
5
  Project-URL: Source, https://github.com/davidbrochart/jpterm/tree/main/plugins/remote_kernels
6
6
  Author-email: David Brochart <david.brochart@gmail.com>
@@ -8,18 +8,18 @@ License-Expression: MIT
8
8
  License-File: LICENSE.txt
9
9
  Classifier: Development Status :: 4 - Beta
10
10
  Classifier: Programming Language :: Python
11
- Classifier: Programming Language :: Python :: 3.10
12
11
  Classifier: Programming Language :: Python :: 3.11
13
12
  Classifier: Programming Language :: Python :: 3.12
14
13
  Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Programming Language :: Python :: 3.15
15
16
  Classifier: Programming Language :: Python :: Implementation :: CPython
16
17
  Classifier: Programming Language :: Python :: Implementation :: PyPy
17
- Requires-Python: >=3.10
18
- Requires-Dist: httpx-ws>=0.4.2
19
- Requires-Dist: httpx>=0.23.1
20
- Requires-Dist: pycrdt<0.13.0,>=0.12.44
21
- Requires-Dist: txl-kernel
22
- Requires-Dist: txl==0.3.3
18
+ Requires-Python: >=3.11
19
+ Requires-Dist: httpx2[ws]>=2.6.0
20
+ Requires-Dist: pycrdt<0.15.0,>=0.14.1
21
+ Requires-Dist: txl-kernel<0.4.0,>=0.3.10
22
+ Requires-Dist: txl==0.3.4
23
23
  Description-Content-Type: text/markdown
24
24
 
25
25
  # TXL plugin for remote kernels
@@ -4,14 +4,14 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "txl_remote_kernels"
7
- version = "0.3.7"
7
+ version = "0.3.8"
8
8
  description = "TXL plugin for remote kernels"
9
9
  readme = "README.md"
10
- requires-python = ">=3.10"
10
+ requires-python = ">=3.11"
11
11
  license = "MIT"
12
12
  keywords = []
13
- classifiers = [ "Development Status :: 4 - Beta", "Programming Language :: Python", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy",]
14
- dependencies = [ "txl ==0.3.3", "txl_kernel", "httpx >=0.23.1", "httpx-ws >=0.4.2", "pycrdt >=0.12.44,<0.13.0",]
13
+ classifiers = [ "Development Status :: 4 - Beta", "Programming Language :: Python", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3.15", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy",]
14
+ dependencies = [ "txl ==0.3.4", "txl_kernel >=0.3.10,<0.4.0", "httpx2[ws]>=2.6.0", "pycrdt >=0.14.1,<0.15.0",]
15
15
  [[project.authors]]
16
16
  name = "David Brochart"
17
17
  email = "david.brochart@gmail.com"
@@ -4,10 +4,8 @@ import uuid
4
4
  from typing import Any, Dict
5
5
  from urllib import parse
6
6
 
7
- import httpx
7
+ import httpx2
8
8
  from anyio import Lock, sleep
9
- from anyioutils import create_task
10
- from httpx_ws import aconnect_ws
11
9
  from txl_kernel.driver import KernelMixin
12
10
  from txl_kernel.message import date_to_str
13
11
 
@@ -37,10 +35,10 @@ class KernelDriver(KernelMixin):
37
35
  parsed_url = parse.urlparse(url)
38
36
  self.base_url = parse.urljoin(url, parsed_url.path).rstrip("/")
39
37
  self.query_params = parse.parse_qs(parsed_url.query)
40
- self.cookies = httpx.Cookies()
38
+ self.cookies = httpx2.Cookies()
41
39
  i = self.base_url.find(":")
42
40
  self.ws_url = ("wss" if self.base_url[i - 1] == "s" else "ws") + self.base_url[i:]
43
- self.start_task = create_task(self.start(), task_group)
41
+ self.start_task = task_group.create_task(self.start())
44
42
  self.comm_handlers = comm_handlers
45
43
  self.shell_channel = "shell"
46
44
  self.control_channel = "control"
@@ -50,7 +48,7 @@ class KernelDriver(KernelMixin):
50
48
 
51
49
  async def start(self):
52
50
  i = str(uuid.uuid4())
53
- async with httpx.AsyncClient() as client:
51
+ async with httpx2.AsyncClient() as client:
54
52
  body = {
55
53
  "kernel": {"name": self.kernel_name},
56
54
  "name": i,
@@ -73,13 +71,12 @@ class KernelDriver(KernelMixin):
73
71
  )
74
72
  if r.status_code != 200 or self.kernel_id != r.json()["id"]:
75
73
  return
76
- async with aconnect_ws(
74
+ async with httpx2.AsyncClient(cookies=self.cookies) as client, client.websocket(
77
75
  f"{self.ws_url}/api/kernels/{self.kernel_id}/channels",
78
76
  params={"session_id": self.session_id},
79
- cookies=self.cookies,
80
77
  subprotocols=["v1.kernel.websocket.jupyter.org"],
81
78
  ) as self.websocket:
82
- recv_task = create_task(self._recv(), self.task_group)
79
+ recv_task = self.task_group.create_task(self._recv())
83
80
  try:
84
81
  await self.wait_for_ready()
85
82
  self.started.set()
@@ -98,7 +95,7 @@ class KernelDriver(KernelMixin):
98
95
  msg = json.loads(message.data)
99
96
  else:
100
97
  msg = from_binary(message.data)
101
- self.recv_queue.put_nowait(msg)
98
+ self.recv_queue.send_nowait(msg)
102
99
 
103
100
  async def send_message(
104
101
  self,
@@ -3,7 +3,7 @@ from __future__ import annotations
3
3
  from typing import Any
4
4
  from urllib import parse
5
5
 
6
- import httpx
6
+ import httpx2
7
7
  from anyio import create_task_group, sleep
8
8
  from fps import Module
9
9
  from pycrdt import Map
@@ -37,12 +37,12 @@ class RemoteKernelspecs(Kernelspecs):
37
37
  parsed_url = parse.urlparse(url)
38
38
  self.base_url = parse.urljoin(url, parsed_url.path).rstrip("/")
39
39
  self.query_params = parse.parse_qs(parsed_url.query)
40
- self.cookies = httpx.Cookies()
40
+ self.cookies = httpx2.Cookies()
41
41
 
42
42
  async def get(self) -> dict[str, Any]:
43
43
  url = f"{self.base_url}/api/kernelspecs"
44
44
  try:
45
- async with httpx.AsyncClient() as client:
45
+ async with httpx2.AsyncClient() as client:
46
46
  r = await client.get(
47
47
  url,
48
48
  params={**self.query_params},
@@ -51,7 +51,7 @@ class RemoteKernelspecs(Kernelspecs):
51
51
  d = r.json()
52
52
  self.cookies.update(r.cookies)
53
53
  return d
54
- except httpx.ConnectError:
54
+ except httpx2.ConnectError:
55
55
  raise RuntimeError(f"Could not connect to a Jupyter server at {url}")
56
56
 
57
57