Skip to content

Commit fc02b56

Browse files
authored
MAINT: remove hard dependency on typing_extensions (#44)
* MAINT: remove hard dependency on typing_extensions * clean up
1 parent 3907691 commit fc02b56

File tree

5 files changed

+22
-26
lines changed

5 files changed

+22
-26
lines changed

Diff for: pixi.lock

+2-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: pyproject.toml

+2-2
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 = "*"

Diff for: src/array_api_extra/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from __future__ import annotations
1+
from __future__ import annotations # https://github.com/pylint-dev/pylint/pull/9990
22

33
from ._funcs import atleast_nd, cov, create_diagonal, expand_dims, kron, setdiff1d, sinc
44

Diff for: src/array_api_extra/_lib/_compat.py

+1-1
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

Diff for: src/array_api_extra/_lib/_typing.py

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
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

6-
# To be changed to a Protocol later (see data-apis/array-api#589)
7-
Array = Any # type: ignore[no-any-explicit]
8-
Device = Any # type: ignore[no-any-explicit]
7+
if typing.TYPE_CHECKING:
8+
from typing_extensions import override
99

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

0 commit comments

Comments
 (0)