Skip to content

MAINT: remove hard dependency on typing_extensions #44

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

Merged
merged 2 commits into from
Nov 30, 2024
Merged
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
20 changes: 2 additions & 18 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ classifiers = [
"Typing :: Typed",
]
dynamic = ["version"]
dependencies = ["typing-extensions"]
dependencies = []

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

[tool.pixi.dependencies]
python = ">=3.10.15,<3.14"
typing_extensions = ">=4.12.2,<4.13"

[tool.pixi.pypi-dependencies]
array-api-extra = { path = ".", editable = true }
@@ -74,6 +73,7 @@ pre-commit = "*"
pylint = "*"
basedmypy = "*"
basedpyright = "*"
typing_extensions = ">=4.12.2,<4.13"
# import dependencies for mypy:
array-api-strict = "*"
numpy = "*"
2 changes: 1 addition & 1 deletion src/array_api_extra/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import annotations
from __future__ import annotations # https://github.com/pylint-dev/pylint/pull/9990

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

2 changes: 1 addition & 1 deletion src/array_api_extra/_lib/_compat.py
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
import sys
import typing

from typing_extensions import override
from ._typing import override

if typing.TYPE_CHECKING:
from ._typing import Array, Device
20 changes: 16 additions & 4 deletions src/array_api_extra/_lib/_typing.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
from __future__ import annotations # https://github.com/pylint-dev/pylint/pull/9990

import typing
from types import ModuleType
from typing import Any

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

__all__ = ["Array", "Device", "ModuleType"]
# To be changed to a Protocol later (see data-apis/array-api#589)
Array = Any # type: ignore[no-any-explicit]
Device = Any # type: ignore[no-any-explicit]
else:

def no_op_decorator(f): # pyright: ignore[reportUnreachable]
return f

override = no_op_decorator

__all__ = ["ModuleType", "override"]
if typing.TYPE_CHECKING:
__all__ += ["Array", "Device"]