Skip to content

Commit 38d351e

Browse files
committed
fix(deps): Remove more typing_extensions from runtime
1 parent 333c68a commit 38d351e

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

src/libvcs/_internal/subprocess.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,29 @@
4242
import subprocess
4343
import sys
4444
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
4846

4947
from libvcs._internal.types import StrOrBytesPath
5048

5149
from .dataclasses import SkipDefaultFieldsReprMixin
5250

51+
if TYPE_CHECKING:
52+
from typing_extensions import TypeAlias
53+
54+
5355
F = TypeVar("F", bound=Callable[..., Any])
5456

5557

5658
if sys.platform == "win32":
57-
_ENV: TypeAlias = Mapping[str, str]
59+
_ENV: "TypeAlias" = Mapping[str, str]
5860
else:
59-
_ENV: TypeAlias = Union[
61+
_ENV: "TypeAlias" = Union[
6062
Mapping[bytes, StrOrBytesPath], Mapping[str, StrOrBytesPath]
6163
]
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]
6466
#: Command
65-
_CMD: TypeAlias = Union[StrOrBytesPath, Sequence[StrOrBytesPath]]
67+
_CMD: "TypeAlias" = Union[StrOrBytesPath, Sequence[StrOrBytesPath]]
6668

6769

6870
@dataclasses.dataclass(repr=False)

src/libvcs/_internal/types.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
.. _typeshed's: https://github.com/python/typeshed/blob/5df8de7/stdlib/_typeshed/__init__.pyi#L115-L118
99
""" # NOQA E501
1010
from os import PathLike
11-
from typing import Literal, Union
11+
from typing import Literal, Union, TYPE_CHECKING
1212

13-
from typing_extensions import TypeAlias
13+
if TYPE_CHECKING:
14+
from typing_extensions import TypeAlias
1415

15-
StrPath: TypeAlias = Union[str, PathLike[str]] # stable
16+
StrPath: "TypeAlias" = Union[str, PathLike[str]] # stable
1617
""":class:`os.PathLike` or :class:`str`"""
1718

18-
StrOrBytesPath: TypeAlias = Union[str, bytes, PathLike[str], PathLike[bytes]] # stable
19+
StrOrBytesPath: "TypeAlias" = Union[str, bytes, PathLike[str], PathLike[bytes]] # stable
1920
""":class:`os.PathLike`, :class:`str` or :term:`bytes-like object`"""
2021

2122

0 commit comments

Comments
 (0)