|
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 ( |
| 46 | + IO, |
| 47 | + TYPE_CHECKING, |
| 48 | + Any, |
| 49 | + Callable, |
| 50 | + Literal, |
| 51 | + Optional, |
| 52 | + TypeVar, |
| 53 | + Union, |
| 54 | + overload, |
| 55 | +) |
48 | 56 |
|
49 | 57 | from libvcs._internal.types import StrOrBytesPath
|
50 | 58 |
|
51 | 59 | from .dataclasses import SkipDefaultFieldsReprMixin
|
52 | 60 |
|
| 61 | +if TYPE_CHECKING: |
| 62 | + from typing_extensions import TypeAlias |
| 63 | + |
| 64 | + |
53 | 65 | F = TypeVar("F", bound=Callable[..., Any])
|
54 | 66 |
|
55 | 67 |
|
56 | 68 | if sys.platform == "win32":
|
57 |
| - _ENV: TypeAlias = Mapping[str, str] |
| 69 | + _ENV: "TypeAlias" = Mapping[str, str] |
58 | 70 | else:
|
59 |
| - _ENV: TypeAlias = Union[ |
| 71 | + _ENV: "TypeAlias" = Union[ |
60 | 72 | Mapping[bytes, StrOrBytesPath], Mapping[str, StrOrBytesPath]
|
61 | 73 | ]
|
62 |
| -_FILE: TypeAlias = Union[None, int, IO[Any]] |
63 |
| -_TXT: TypeAlias = Union[bytes, str] |
| 74 | +_FILE: "TypeAlias" = Union[None, int, IO[Any]] |
| 75 | +_TXT: "TypeAlias" = Union[bytes, str] |
64 | 76 | #: Command
|
65 |
| -_CMD: TypeAlias = Union[StrOrBytesPath, Sequence[StrOrBytesPath]] |
| 77 | +_CMD: "TypeAlias" = Union[StrOrBytesPath, Sequence[StrOrBytesPath]] |
66 | 78 |
|
67 | 79 |
|
68 | 80 | @dataclasses.dataclass(repr=False)
|
|
0 commit comments