|
42 | 42 | import subprocess
|
43 | 43 | import sys
|
44 | 44 | from collections.abc import Mapping, Sequence
|
45 |
| -from typing import IO, Any, Callable, Literal, Optional, TypeVar, Union, overload |
46 |
| - |
47 |
| -from typing_extensions import TypeAlias |
| 45 | +from typing import IO, Any, Callable, Literal, Optional, TypeVar, Union, overload, TYPE_CHECKING |
48 | 46 |
|
49 | 47 | from libvcs._internal.types import StrOrBytesPath
|
50 | 48 |
|
51 | 49 | from .dataclasses import SkipDefaultFieldsReprMixin
|
52 | 50 |
|
| 51 | +if TYPE_CHECKING: |
| 52 | + from typing_extensions import TypeAlias |
| 53 | + |
| 54 | + |
53 | 55 | F = TypeVar("F", bound=Callable[..., Any])
|
54 | 56 |
|
55 | 57 |
|
56 | 58 | if sys.platform == "win32":
|
57 |
| - _ENV: TypeAlias = Mapping[str, str] |
| 59 | + _ENV: "TypeAlias" = Mapping[str, str] |
58 | 60 | else:
|
59 |
| - _ENV: TypeAlias = Union[ |
| 61 | + _ENV: "TypeAlias" = Union[ |
60 | 62 | Mapping[bytes, StrOrBytesPath], Mapping[str, StrOrBytesPath]
|
61 | 63 | ]
|
62 |
| -_FILE: TypeAlias = Union[None, int, IO[Any]] |
63 |
| -_TXT: TypeAlias = Union[bytes, str] |
| 64 | +_FILE: "TypeAlias" = Union[None, int, IO[Any]] |
| 65 | +_TXT: "TypeAlias" = Union[bytes, str] |
64 | 66 | #: Command
|
65 |
| -_CMD: TypeAlias = Union[StrOrBytesPath, Sequence[StrOrBytesPath]] |
| 67 | +_CMD: "TypeAlias" = Union[StrOrBytesPath, Sequence[StrOrBytesPath]] |
66 | 68 |
|
67 | 69 |
|
68 | 70 | @dataclasses.dataclass(repr=False)
|
|
0 commit comments