Skip to content

Commit b987702

Browse files
authored
Fix typing-extensions dependency, fix mypy (#437)
2 parents 4f693f1 + d60a45d commit b987702

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

CHANGES

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ $ pip install --user --upgrade --pre libvcs
2222
- Raises error if no items found (unless `default=` keyword argument passed)
2323
- Raises error if multipe items found
2424

25+
### Bug fixes
26+
27+
- Remove required dependency of typing-extensions (#437)
28+
- Ignore a single line of mypy check in dataclasses for now (#437)
29+
2530
## libvcs 0.20.0 (2022-10-31)
2631

2732
### What's new

src/libvcs/_internal/dataclasses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def __repr__(self) -> str:
7676
"""Omit default fields in object representation."""
7777
nodef_f_vals = (
7878
(f.name, attrgetter(f.name)(self))
79-
for f in dataclasses.fields(self)
79+
for f in dataclasses.fields(self) # type:ignore
8080
if attrgetter(f.name)(self) != f.default
8181
)
8282

src/libvcs/_internal/run.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
from collections.abc import Iterable, Mapping, MutableMapping, Sequence
1515
from typing import IO, TYPE_CHECKING, Any, AnyStr, Callable, Optional, Protocol, Union
1616

17-
from typing_extensions import TypeAlias
18-
1917
from libvcs._internal.types import StrOrBytesPath
2018

2119
from .. import exc
@@ -37,6 +35,7 @@ def console_to_str(s: bytes) -> str:
3735

3836
if TYPE_CHECKING:
3937
_LoggerAdapter = logging.LoggerAdapter[logging.Logger]
38+
from typing_extensions import TypeAlias
4039
else:
4140
_LoggerAdapter = logging.LoggerAdapter
4241

@@ -87,14 +86,14 @@ def __call__(self, output: AnyStr, timestamp: datetime.datetime) -> None:
8786

8887

8988
if sys.platform == "win32":
90-
_ENV: TypeAlias = Mapping[str, str]
89+
_ENV: "TypeAlias" = Mapping[str, str]
9190
else:
92-
_ENV: TypeAlias = Union[
91+
_ENV: "TypeAlias" = Union[
9392
Mapping[bytes, StrOrBytesPath], Mapping[str, StrOrBytesPath]
9493
]
9594

9695
_CMD = Union[StrOrBytesPath, Sequence[StrOrBytesPath]]
97-
_FILE: TypeAlias = Optional[Union[int, IO[Any]]]
96+
_FILE: "TypeAlias" = Optional[Union[int, IO[Any]]]
9897

9998

10099
def run(

0 commit comments

Comments
 (0)