Skip to content

Commit 47faa48

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 4bc0a1e commit 47faa48

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/tox/config/cli/parser.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Customize argparse logic for tox (also contains the base options).""" # noqa: A005
1+
"""Customize argparse logic for tox (also contains the base options)."""
22

33
from __future__ import annotations
44

@@ -12,6 +12,7 @@
1212
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Literal, Optional, Sequence, Tuple, Type, TypeVar, cast
1313

1414
from colorama import Fore
15+
from typing_extensions import Self
1516

1617
from tox.config.loader.str_convert import StrConvert
1718
from tox.plugin import NAME
@@ -287,11 +288,11 @@ def add_argument(self, *args: str, of_type: type[Any] | None = None, **kwargs: A
287288
return result
288289

289290
@classmethod
290-
def base(cls: type[ToxParserT]) -> ToxParserT:
291+
def base(cls) -> Self:
291292
return cls(add_help=False, root=True)
292293

293294
@classmethod
294-
def core(cls: type[ToxParserT]) -> ToxParserT:
295+
def core(cls) -> Self:
295296
return cls(
296297
prog=NAME,
297298
formatter_class=HelpFormatter,

src/tox/config/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from __future__ import annotations # noqa: A005
1+
from __future__ import annotations
22

33
from collections import OrderedDict
44
from typing import Iterator, Sequence

src/tox/util/spinner.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from typing import IO, TYPE_CHECKING, NamedTuple, Sequence, TypeVar
1212

1313
from colorama import Fore
14+
from typing_extensions import Self
1415

1516
if TYPE_CHECKING:
1617
from types import TracebackType
@@ -104,7 +105,7 @@ def frame(self) -> str:
104105
text_frame = textwrap.shorten(text_frame, width=self.max_width - 1, placeholder="...")
105106
return f"{frame} {text_frame}"
106107

107-
def __enter__(self: T) -> T:
108+
def __enter__(self) -> Self:
108109
if self.enabled:
109110
self.disable_cursor()
110111
self.render_frame()

0 commit comments

Comments
 (0)