Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [ '3.10', '3.11', '3.12' ]
python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14' ]

steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion plugins/cell/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ requires-python = ">=3.10"
license = "MIT"
keywords = []
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",]
dependencies = [ "txl ==0.3.2", "pycrdt >=0.10.9,<0.13.0",]
dependencies = [ "txl ==0.3.2", "pycrdt >=0.12.44,<0.13.0",]
[[project.authors]]
name = "David Brochart"
email = "david.brochart@gmail.com"
Expand Down
2 changes: 1 addition & 1 deletion plugins/kernel/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ requires-python = ">=3.10"
license = "MIT"
keywords = []
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",]
dependencies = [ "txl ==0.3.2", "python-dateutil >=2.8.2", "pycrdt >=0.10.9,<0.13.0",]
dependencies = [ "txl ==0.3.2", "python-dateutil >=2.8.2", "pycrdt >=0.12.44,<0.13.0",]
[[project.authors]]
name = "David Brochart"
email = "david.brochart@gmail.com"
Expand Down
2 changes: 1 addition & 1 deletion plugins/notebook_editor/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ requires-python = ">=3.10"
license = "MIT"
keywords = []
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",]
dependencies = [ "txl ==0.3.2", "pycrdt >=0.10.9,<0.13.0", "jupyter-ydoc >=3.0.2,<4.0.0",]
dependencies = [ "txl ==0.3.2", "pycrdt >=0.12.44,<0.13.0", "jupyter-ydoc >=3.0.2,<4.0.0",]
[[project.authors]]
name = "David Brochart"
email = "david.brochart@gmail.com"
Expand Down
2 changes: 1 addition & 1 deletion plugins/remote_contents/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ requires-python = ">=3.10"
license = "MIT"
keywords = []
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",]
dependencies = [ "txl ==0.3.2", "httpx>=0.23.1", "httpx-ws>=0.4.2", "pycrdt >=0.10.9,<0.11.0", "pycrdt-websocket >=0.15.3,<0.16.0", "jupyter-ydoc >=3.0.2,<4.0.0",]
dependencies = [ "txl ==0.3.2", "httpx>=0.23.1", "httpx-ws>=0.4.2", "pycrdt >=0.12.44,<0.13.0", "pycrdt-websocket >=0.16.0,<0.17.0", "jupyter-ydoc >=3.0.2,<4.0.0",]
[[project.authors]]
name = "David Brochart"
email = "david.brochart@gmail.com"
Expand Down
39 changes: 6 additions & 33 deletions plugins/remote_contents/txl_remote_contents/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,17 @@
from urllib import parse

import httpx
from anyio import create_task_group, sleep
from anyio import create_task_group, sleep_forever
from fps import Module
from httpx_ws import aconnect_ws
from pycrdt import Doc
from pycrdt_websocket import WebsocketProvider
from pycrdt import Doc, Provider
from pycrdt.websocket.websocket import HttpxWebsocket

from txl.base import Contents

ydocs = {ep.name: ep.load() for ep in entry_points(group="jupyter_ydoc")}


class Websocket:
def __init__(self, websocket, roomid: str):
self.websocket = websocket
self.roomid = roomid

@property
def path(self) -> str:
return self.roomid

def __aiter__(self):
return self

async def __anext__(self) -> bytes:
try:
message = await self.recv()
except BaseException:
raise StopAsyncIteration()
return message

async def send(self, message: bytes):
await self.websocket.send_bytes(message)

async def recv(self) -> bytes:
b = await self.websocket.receive_bytes()
return bytes(b)


class Entry:
"""Provide a scandir-like API"""

Expand Down Expand Up @@ -175,8 +148,8 @@ async def websocket_provider(self, room_id, ydoc, session_id=None):
async with aconnect_ws(
ws_url, cookies=self.cookies, params=params
) as websocket:
async with WebsocketProvider(ydoc, Websocket(websocket, room_id)):
await sleep(float("inf"))
async with Provider(ydoc, HttpxWebsocket(websocket, room_id)):
await sleep_forever()


class RemoteContentsModule(Module):
Expand All @@ -194,4 +167,4 @@ async def start(self) -> None:
contents = RemoteContents(base_url, query_params, cookies, self.collaborative, tg)
self.put(contents, Contents)
self.done()
await sleep(float("inf"))
await sleep_forever()
2 changes: 1 addition & 1 deletion plugins/remote_kernels/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ requires-python = ">=3.10"
license = "MIT"
keywords = []
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",]
dependencies = [ "txl ==0.3.2", "txl_kernel", "httpx >=0.23.1", "httpx-ws >=0.4.2", "pycrdt >=0.10.9,<0.13.0",]
dependencies = [ "txl ==0.3.2", "txl_kernel", "httpx >=0.23.1", "httpx-ws >=0.4.2", "pycrdt >=0.12.44,<0.13.0",]
[[project.authors]]
name = "David Brochart"
email = "david.brochart@gmail.com"
Expand Down
2 changes: 1 addition & 1 deletion plugins/widgets/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ requires-python = ">=3.10"
license = "MIT"
keywords = []
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",]
dependencies = [ "txl ==0.3.2", "ypywidgets >=0.9.4,<0.10.0", "ypywidgets-textual >=0.5.4,<0.6.0", "pycrdt >=0.10.9,<0.13.0",]
dependencies = [ "txl ==0.3.2", "ypywidgets >=0.9.4,<0.10.0", "ypywidgets-textual >=0.5.4,<0.6.0", "pycrdt >=0.12.44,<0.13.0",]
[[project.authors]]
name = "David Brochart"
email = "david.brochart@gmail.com"
Expand Down
Loading