Skip to content

Commit 02c3794

Browse files
committed
Remove typing_extensions requirement
1 parent c3a0a76 commit 02c3794

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ dependencies = [
5050
# cffi is required on Windows, except on PyPy where it is built-in
5151
"cffi>=1.14; os_name == 'nt' and implementation_name != 'pypy'",
5252
"exceptiongroup; python_version < '3.11'",
53-
# using typing_extensions.depreciated in _sync.py
54-
"typing_extensions >= 4.15.0",
5553
]
5654
dynamic = ["version"]
5755

src/trio/_sync.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from __future__ import annotations
22

33
import math
4-
from typing import TYPE_CHECKING, Literal, Protocol
4+
from typing import TYPE_CHECKING, Literal, Protocol, TypeVar
55

66
import attrs
7-
from typing_extensions import deprecated
87

98
import trio
109

@@ -21,10 +20,27 @@
2120
from ._util import final
2221

2322
if TYPE_CHECKING:
23+
from collections.abc import Callable
2424
from types import TracebackType
2525

26+
from typing_extensions import deprecated
27+
2628
from ._core import Task
2729
from ._core._parking_lot import ParkingLotStatistics
30+
else:
31+
T = TypeVar("T")
32+
33+
def deprecated(
34+
message: str,
35+
/,
36+
*,
37+
category: type[Warning] | None = DeprecationWarning,
38+
stacklevel: int = 1,
39+
) -> Callable[[T], T]:
40+
def wrapper(f: T) -> T:
41+
return f
42+
43+
return wrapper
2844

2945

3046
@attrs.frozen

test-requirements.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,3 @@ outcome
3939
sniffio
4040
# 1.2.1 fixes types
4141
exceptiongroup >= 1.2.1; python_version < "3.11"
42-
typing_extensions >= 4.15.0

0 commit comments

Comments
 (0)