use annotated
This commit is contained in:
parent
c3051cd3e2
commit
86f1ce89d1
@ -12,7 +12,7 @@ import urllib.parse
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Dict, List, Optional, Set
|
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.exceptions import ConfigError, EnvironmentVarValueError
|
||||||
from reflex.utils.types import GenericType, is_union, value_inside_optional
|
from reflex.utils.types import GenericType, is_union, value_inside_optional
|
||||||
@ -303,17 +303,7 @@ def interpret_env_var_value(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class ExistingPath(Path):
|
ExistingPath = Annotated[Path, {"exists": True}]
|
||||||
"""A path that must exist."""
|
|
||||||
|
|
||||||
@property
|
|
||||||
def __class__(self):
|
|
||||||
"""Get the class of the path.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
The class of the path.
|
|
||||||
"""
|
|
||||||
return Path
|
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(init=False)
|
@dataclasses.dataclass(init=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user