Skip to content

Commit e061e10

Browse files
committed
MAINT: remove hard dependency on typing_extensions
1 parent 3907691 commit e061e10

File tree

4 files changed

+18
-23
lines changed

4 files changed

+18
-23
lines changed

pixi.lock

Lines changed: 2 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ classifiers = [
2626
"Typing :: Typed",
2727
]
2828
dynamic = ["version"]
29-
dependencies = ["typing-extensions"]
29+
dependencies = []
3030

3131
[project.optional-dependencies]
3232
tests = [
@@ -64,7 +64,6 @@ platforms = ["linux-64", "osx-arm64", "win-64"]
6464

6565
[tool.pixi.dependencies]
6666
python = ">=3.10.15,<3.14"
67-
typing_extensions = ">=4.12.2,<4.13"
6867

6968
[tool.pixi.pypi-dependencies]
7069
array-api-extra = { path = ".", editable = true }
@@ -74,6 +73,7 @@ pre-commit = "*"
7473
pylint = "*"
7574
basedmypy = "*"
7675
basedpyright = "*"
76+
typing_extensions = ">=4.12.2,<4.13"
7777
# import dependencies for mypy:
7878
array-api-strict = "*"
7979
numpy = "*"

src/array_api_extra/_lib/_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77
import typing
88

9-
from typing_extensions import override
9+
from ._typing import override
1010

1111
if typing.TYPE_CHECKING:
1212
from ._typing import Array, Device

src/array_api_extra/_lib/_typing.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
from __future__ import annotations # https://github.com/pylint-dev/pylint/pull/9990
22

3+
import typing
34
from types import ModuleType
45
from typing import Any
56

7+
if typing.TYPE_CHECKING:
8+
from typing_extensions import override
9+
else:
10+
11+
def no_op_decorator(f): # pyright: ignore[reportUnreachable]
12+
return f
13+
14+
override = no_op_decorator
15+
16+
__all__ = ["Array", "Device", "ModuleType", "override"]
17+
18+
619
# To be changed to a Protocol later (see data-apis/array-api#589)
720
Array = Any # type: ignore[no-any-explicit]
821
Device = Any # type: ignore[no-any-explicit]
9-
10-
__all__ = ["Array", "Device", "ModuleType"]

0 commit comments

Comments
 (0)