Skip to content

Commit 2bb5c5d

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

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

src/libvcs/_internal/subprocess.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,39 @@
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 (
46+
IO,
47+
TYPE_CHECKING,
48+
Any,
49+
Callable,
50+
Literal,
51+
Optional,
52+
TypeVar,
53+
Union,
54+
overload,
55+
)
4856

4957
from libvcs._internal.types import StrOrBytesPath
5058

5159
from .dataclasses import SkipDefaultFieldsReprMixin
5260

61+
if TYPE_CHECKING:
62+
from typing_extensions import TypeAlias
63+
64+
5365
F = TypeVar("F", bound=Callable[..., Any])
5466

5567

5668
if sys.platform == "win32":
57-
_ENV: TypeAlias = Mapping[str, str]
69+
_ENV: "TypeAlias" = Mapping[str, str]
5870
else:
59-
_ENV: TypeAlias = Union[
71+
_ENV: "TypeAlias" = Union[
6072
Mapping[bytes, StrOrBytesPath], Mapping[str, StrOrBytesPath]
6173
]
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]
6476
#: Command
65-
_CMD: TypeAlias = Union[StrOrBytesPath, Sequence[StrOrBytesPath]]
77+
_CMD: "TypeAlias" = Union[StrOrBytesPath, Sequence[StrOrBytesPath]]
6678

6779

6880
@dataclasses.dataclass(repr=False)

src/libvcs/_internal/types.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@
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 TYPE_CHECKING, Literal, Union
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[
20+
str, bytes, PathLike[str], PathLike[bytes] # stable
21+
]
1922
""":class:`os.PathLike`, :class:`str` or :term:`bytes-like object`"""
2023

2124

0 commit comments

Comments
 (0)