From 86f1ce89d1753798e1de57920e545e2ef74a6fc4 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Tue, 29 Oct 2024 11:07:38 -0700 Subject: [PATCH] use annotated --- reflex/config.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/reflex/config.py b/reflex/config.py index 1a76625dc..ef0524ded 100644 --- a/reflex/config.py +++ b/reflex/config.py @@ -12,7 +12,7 @@ import urllib.parse from pathlib import Path from typing import Any, Dict, List, Optional, Set -from typing_extensions import get_type_hints +from typing_extensions import Annotated, get_type_hints from reflex.utils.exceptions import ConfigError, EnvironmentVarValueError from reflex.utils.types import GenericType, is_union, value_inside_optional @@ -303,17 +303,7 @@ def interpret_env_var_value( ) -class ExistingPath(Path): - """A path that must exist.""" - - @property - def __class__(self): - """Get the class of the path. - - Returns: - The class of the path. - """ - return Path +ExistingPath = Annotated[Path, {"exists": True}] @dataclasses.dataclass(init=False)