Skip to content

Commit 75a4998

Browse files
committed
remove old stuff, docs, cleanup
1 parent f0b0fd6 commit 75a4998

9 files changed

+27
-120
lines changed

js/hello.tsx

-25
This file was deleted.

sractch-flat.py

-54
This file was deleted.

src/fused_local/lib.py

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
"""
2+
User-facing functions of the ``fused_local`` library.
3+
4+
Only `tile` and `configure_map` actually exist yet.
5+
The rest are ideas of what the interface will be like.
6+
"""
7+
18
from functools import singledispatchmethod
29
import geopy.geocoders
310
from typing import Callable, Concatenate, Generic, ParamSpec, Self, TypeVar

src/fused_local/local_certs.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"Generate self-signed certificates for serving HTTPS locally"
2+
13
import datetime
24

35
from os import PathLike

src/fused_local/serve.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
from typing import Annotated
33

44
import trio
5-
from hypercorn.trio import serve
5+
import typer
66
from hypercorn.config import Config as HyperConfig
7+
from hypercorn.trio import serve
78

9+
import fused_local.config
810
from fused_local.app import app, setup_static_serving
911
from fused_local.local_certs import generate_certs
10-
import fused_local.config
11-
12-
import typer
1312

1413
# TODO: we can't easily serve HTTP/2 over localhost, because it requires HTTPS.
1514
# The browser won't trust our self-signed certificates, which isn't great UX.

src/fused_local/tiler-rio.py

-35
This file was deleted.

src/fused_local/user_code.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from pathlib import Path
21
import importlib.util
32
import sys
3+
from pathlib import Path
44
from types import ModuleType
55

66
import anyio
@@ -43,6 +43,8 @@ def reload_user_code(path: Path) -> None:
4343

4444

4545
class RepeatEvent:
46+
"anyio Event that can be reset"
47+
4648
_event: anyio.Event
4749

4850
def __init__(self) -> None:
@@ -64,6 +66,7 @@ def reset(self) -> None:
6466

6567

6668
async def watch_with_event(path: Path, event: RepeatEvent) -> RepeatEvent:
69+
"Watch a file/directory; reset the event every time it changes"
6770
async for _ in awatch(path):
6871
event.reset()
6972

src/fused_local/workers.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
"""
2+
Something kinda like a process pool, for Trio.
3+
4+
Wraps ``trio-parallel`` to add support for restarting the worker pool.
5+
6+
(We might want to use this when user code changes.)
7+
8+
Currently we don't actually restart the pool because it's way too slow.
9+
"""
10+
111
import os
212
from functools import partial
313
from pathlib import Path

tests/test_cancellation_middleware.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from fastapi.testclient import TestClient
66
# from fused_local.cancellation_middleware import CancelOnDisconnectMiddleware
77

8-
pytest.mark.skip(reason="Test doesn't work")
8+
pytest.skip(reason="Test doesn't work", allow_module_level=True)
99

1010
app = FastAPI()
1111
# app.add_middleware(CancelOnDisconnectMiddleware)

0 commit comments

Comments
 (0)