From e5817bcef401e45c85dff85d0658de590d178ff5 Mon Sep 17 00:00:00 2001 From: Elijah Date: Mon, 13 Jan 2025 11:23:34 +0000 Subject: [PATCH] typing to named tuple --- reflex/utils/prerequisites.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 154a8b033..810c7ab75 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -22,8 +22,7 @@ import zipfile from datetime import datetime from pathlib import Path from types import ModuleType -from typing import Callable, List, Optional -from collections import namedtuple +from typing import Callable, List, NamedTuple, Optional import httpx import typer @@ -49,7 +48,14 @@ if typing.TYPE_CHECKING: 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) class Template: """A template for a Reflex app."""