typing to named tuple

This commit is contained in:
Elijah 2025-01-13 11:23:34 +00:00
parent d32033e210
commit e5817bcef4

View File

@ -22,8 +22,7 @@ import zipfile
from datetime import datetime from datetime import datetime
from pathlib import Path from pathlib import Path
from types import ModuleType from types import ModuleType
from typing import Callable, List, Optional from typing import Callable, List, NamedTuple, Optional
from collections import namedtuple
import httpx import httpx
import typer import typer
@ -49,7 +48,14 @@ if typing.TYPE_CHECKING:
CURRENTLY_INSTALLING_NODE = False CURRENTLY_INSTALLING_NODE = False
AppInfo = namedtuple("AppInfo", ["app", "module"])
class AppInfo(NamedTuple):
"""A tuple containing the app instance and module."""
app: App
module: ModuleType
@dataclasses.dataclass(frozen=True) @dataclasses.dataclass(frozen=True)
class Template: class Template:
"""A template for a Reflex app.""" """A template for a Reflex app."""