Skip to content

Commit 4af2afe

Browse files
committed
Remove vendored typing-extensions
1 parent 58f5d87 commit 4af2afe

File tree

14 files changed

+19
-4538
lines changed

14 files changed

+19
-4538
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ repos:
4141
'types-setuptools==68.2.0.0',
4242
'types-freezegun==1.1.10',
4343
'types-pyyaml==6.0.12.12',
44+
'typing-extensions',
4445
]
4546

4647
- repo: https://github.com/pre-commit/pygrep-hooks

news/typing_extensions.vendor.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Upgrade typing_extensions to 4.14.1
1+
Remove vendored typing-extensions.

src/pip/_internal/index/package_finder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
from pip._internal.utils.unpacking import SUPPORTED_EXTENSIONS
4646

4747
if TYPE_CHECKING:
48-
from pip._vendor.typing_extensions import TypeGuard
48+
from typing_extensions import TypeGuard
4949

5050
__all__ = ["FormatControl", "BestCandidateResult", "PackageFinder"]
5151

src/pip/_internal/models/pylock.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
from collections.abc import Iterable
66
from dataclasses import dataclass
77
from pathlib import Path
8-
from typing import Any
8+
from typing import TYPE_CHECKING, Any
99

1010
from pip._vendor import tomli_w
11-
from pip._vendor.typing_extensions import Self
1211

1312
from pip._internal.models.direct_url import ArchiveInfo, DirInfo, VcsInfo
1413
from pip._internal.models.link import Link
1514
from pip._internal.req.req_install import InstallRequirement
1615
from pip._internal.utils.urls import url_to_path
1716

17+
if TYPE_CHECKING:
18+
from typing_extensions import Self
19+
1820
PYLOCK_FILE_NAME_RE = re.compile(r"^pylock\.([^.]+)\.toml$")
1921

2022

src/pip/_internal/utils/retry.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
from __future__ import annotations
2+
13
import functools
24
from time import perf_counter, sleep
3-
from typing import Callable, TypeVar
5+
from typing import TYPE_CHECKING, Callable, TypeVar
46

5-
from pip._vendor.typing_extensions import ParamSpec
7+
if TYPE_CHECKING:
8+
from typing_extensions import ParamSpec
69

7-
T = TypeVar("T")
8-
P = ParamSpec("P")
10+
T = TypeVar("T")
11+
P = ParamSpec("P")
912

1013

1114
def retry(

src/pip/_vendor/pkg_resources/__init__.py

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

101101
if TYPE_CHECKING:
102102
from _typeshed import BytesPath, StrPath, StrOrBytesPath
103-
from pip._vendor.typing_extensions import Self
103+
from typing_extensions import Self
104104

105105

106106
# Patch: Remove deprecation warning from vendored pkg_resources.

src/pip/_vendor/rich/live.py

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

1717
if TYPE_CHECKING:
1818
# Can be replaced with `from typing import Self` in Python 3.11+
19-
from pip._vendor.typing_extensions import Self # pragma: no cover
19+
from typing_extensions import Self # pragma: no cover
2020

2121

2222
class _RefreshThread(Thread):

src/pip/_vendor/rich/progress.py

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

3939
if TYPE_CHECKING:
4040
# Can be replaced with `from typing import Self` in Python 3.11+
41-
from pip._vendor.typing_extensions import Self # pragma: no cover
41+
from typing_extensions import Self # pragma: no cover
4242

4343
from . import filesize, get_console
4444
from .console import Console, Group, JustifyMethod, RenderableType

src/pip/_vendor/truststore/_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from ._openssl import _configure_context, _verify_peercerts_impl
2323

2424
if typing.TYPE_CHECKING:
25-
from pip._vendor.typing_extensions import Buffer
25+
from typing_extensions import Buffer
2626

2727
# From typeshed/stdlib/ssl.pyi
2828
_StrOrBytesPath: typing.TypeAlias = str | bytes | os.PathLike[str] | os.PathLike[bytes]

src/pip/_vendor/typing_extensions.LICENSE

Lines changed: 0 additions & 279 deletions
This file was deleted.

0 commit comments

Comments
 (0)