Skip to content

Remove vendored typing-extensions #13336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/13336.vendor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove vendored typing-extensions
13 changes: 10 additions & 3 deletions src/pip/_internal/utils/retry.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import functools
from time import perf_counter, sleep
from typing import Callable, TypeVar
from typing import TYPE_CHECKING, Callable, TypeVar

if TYPE_CHECKING:
# TODO: import from typing once Python 3.10 is dropped.
from pip._vendor.typing_extensions import ParamSpec
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should import directly from typing_extensions and then add it's to the mypy pre commit additional dependencies:

additional_dependencies: [

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I need to fix the vendoring imports. vendoring is complaining because pip._vendor.typing_extensions does not exist anymore. I'll do that once Rich accepts my PR and cuts a new release.

else:

def ParamSpec(name: str) -> None:
return None

from pip._vendor.typing_extensions import ParamSpec

T = TypeVar("T")
P = ParamSpec("P")
Expand All @@ -25,7 +32,7 @@ def retry(
def wrapper(func: Callable[P, T]) -> Callable[P, T]:

@functools.wraps(func)
def retry_wrapped(*args: P.args, **kwargs: P.kwargs) -> T:
def retry_wrapped(*args: "P.args", **kwargs: "P.kwargs") -> T:
# The performance counter is monotonic on all platforms we care
# about and has much better resolution than time.monotonic().
start_time = perf_counter()
Expand Down
279 changes: 0 additions & 279 deletions src/pip/_vendor/typing_extensions.LICENSE

This file was deleted.

Loading
Loading