Skip to content

Commit 9d9320c

Browse files
committed
Manually fix issues that could not be automatically fixed
1 parent 7f9b938 commit 9d9320c

File tree

12 files changed

+18
-37
lines changed

12 files changed

+18
-37
lines changed

src/pip/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import List, Optional
1+
from typing import Optional
22

33
__version__ = "25.2.dev0"
44

src/pip/_internal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import List, Optional
1+
from typing import Optional
22

33
from pip._internal.utils import _log
44

src/pip/_internal/cli/command_context.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from collections.abc import Generator
2-
from contextlib import ExitStack, contextmanager
3-
from typing import ContextManager, TypeVar
2+
from contextlib import AbstractContextManager, ExitStack, contextmanager
3+
from typing import TypeVar
44

55
_T = TypeVar("_T", covariant=True)
66

@@ -22,7 +22,7 @@ def main_context(self) -> Generator[None, None, None]:
2222
finally:
2323
self._in_main_context = False
2424

25-
def enter_context(self, context_provider: ContextManager[_T]) -> _T:
25+
def enter_context(self, context_provider: AbstractContextManager[_T]) -> _T:
2626
assert self._in_main_context
2727

2828
return self._main_context.enter_context(context_provider)

src/pip/_internal/commands/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import importlib
66
from collections import namedtuple
7-
from typing import Any, Dict, Optional
7+
from typing import Any, Optional
88

99
from pip._internal.cli.base_command import Command
1010

src/pip/_internal/commands/freeze.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import sys
22
from optparse import Values
3-
from typing import AbstractSet
43

54
from pip._internal.cli import cmdoptions
65
from pip._internal.cli.base_command import Command
@@ -13,7 +12,7 @@ def _should_suppress_build_backends() -> bool:
1312
return sys.version_info < (3, 12)
1413

1514

16-
def _dev_pkgs() -> AbstractSet[str]:
15+
def _dev_pkgs() -> set[str]:
1716
pkgs = {"pip"}
1817

1918
if _should_suppress_build_backends():

src/pip/_internal/locations/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pathlib
55
import sys
66
import sysconfig
7-
from typing import Any, Dict, Optional
7+
from typing import Any, Optional
88

99
from pip._internal.models.scheme import SCHEME_KEYS, Scheme
1010
from pip._internal.utils.compat import WINDOWS

src/pip/_internal/metadata/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import functools
33
import os
44
import sys
5-
from typing import List, Literal, Optional, Protocol, Type, cast
5+
from typing import Literal, Optional, Protocol, cast
66

77
from pip._internal.utils.deprecation import deprecated
88
from pip._internal.utils.misc import strtobool

src/pip/_internal/req/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import logging
33
from collections.abc import Generator, Sequence
44
from dataclasses import dataclass
5-
from typing import List, Optional, Tuple
5+
from typing import Optional
66

77
from pip._internal.cli.progress_bars import get_install_progress_renderer
88
from pip._internal.utils.logging import indent_log

tests/conftest.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,13 @@
99
import sys
1010
import threading
1111
from collections.abc import Iterable, Iterator
12+
from contextlib import AbstractContextManager
1213
from dataclasses import dataclass
1314
from enum import Enum
1415
from hashlib import sha256
1516
from pathlib import Path
1617
from textwrap import dedent
17-
from typing import (
18-
TYPE_CHECKING,
19-
Any,
20-
AnyStr,
21-
Callable,
22-
ClassVar,
23-
ContextManager,
24-
Optional,
25-
)
18+
from typing import TYPE_CHECKING, Any, AnyStr, Callable, ClassVar, Optional
2619
from unittest.mock import patch
2720
from zipfile import ZipFile
2821

@@ -332,7 +325,7 @@ def scoped_global_tempdir_manager(request: pytest.FixtureRequest) -> Iterator[No
332325
temporary directories in the application.
333326
"""
334327
if "no_auto_tempdir_manager" in request.keywords:
335-
ctx: Callable[[], ContextManager[None]] = contextlib.nullcontext
328+
ctx: Callable[[], AbstractContextManager[None]] = contextlib.nullcontext
336329
else:
337330
ctx = global_tempdir_manager
338331

tests/lib/__init__.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,7 @@
1313
from hashlib import sha256
1414
from io import BytesIO, StringIO
1515
from textwrap import dedent
16-
from typing import (
17-
Any,
18-
AnyStr,
19-
Callable,
20-
Dict,
21-
List,
22-
Literal,
23-
Optional,
24-
Protocol,
25-
Tuple,
26-
Union,
27-
cast,
28-
)
16+
from typing import Any, AnyStr, Callable, Literal, Optional, Protocol, Union, cast
2917
from urllib.parse import urlparse, urlunparse
3018
from urllib.request import pathname2url
3119
from zipfile import ZipFile

0 commit comments

Comments
 (0)