Skip to content

Commit 7fa1667

Browse files
authored
Merge pull request #140 from crusaderky/typing39
Drop Python 3.9 support
2 parents f045ed1 + e7c81bc commit 7fa1667

18 files changed

+6
-54
lines changed

array_api_strict/_array_object.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@
1616
from __future__ import annotations
1717

1818
import operator
19-
import sys
2019
from collections.abc import Iterator
2120
from enum import IntEnum
22-
from types import ModuleType
23-
from typing import TYPE_CHECKING, Any, Final, Literal, SupportsIndex
21+
from types import EllipsisType, ModuleType
22+
from typing import Any, Final, Literal, SupportsIndex
2423

2524
import numpy as np
2625
import numpy.typing as npt
@@ -43,13 +42,6 @@
4342
from ._flags import get_array_api_strict_flags, set_array_api_strict_flags
4443
from ._typing import PyCapsule
4544

46-
if sys.version_info >= (3, 10):
47-
from types import EllipsisType
48-
elif TYPE_CHECKING:
49-
from typing_extensions import EllipsisType
50-
else:
51-
EllipsisType = type(Ellipsis)
52-
5345

5446
class Device:
5547
_device: Final[str]

array_api_strict/_data_type_functions.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from dataclasses import dataclass
42

53
import numpy as np

array_api_strict/_dtypes.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import builtins
42
import warnings
53
from typing import Any, Final

array_api_strict/_elementwise_functions.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import numpy as np
42

53
from ._array_object import Array

array_api_strict/_fft.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from collections.abc import Sequence
42
from typing import Literal
53

array_api_strict/_flags.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,16 @@
1111
library will only support one particular configuration of these flags.
1212
1313
"""
14-
15-
from __future__ import annotations
16-
1714
import functools
1815
import os
1916
import warnings
2017
from collections.abc import Callable
2118
from types import TracebackType
22-
from typing import TYPE_CHECKING, Any, Collection, TypeVar, cast
19+
from typing import Any, Collection, ParamSpec, TypeVar, cast
2320

2421
import array_api_strict
2522

26-
if TYPE_CHECKING:
27-
# TODO import from typing (requires Python >= 3.10)
28-
from typing_extensions import ParamSpec
29-
30-
P = ParamSpec("P")
31-
23+
P = ParamSpec("P")
3224
T = TypeVar("T")
3325
_CallableT = TypeVar("_CallableT", bound=Callable[..., object])
3426

array_api_strict/_helpers.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""Private helper routines."""
22

3-
from __future__ import annotations
4-
53
from ._array_object import Array
64
from ._dtypes import _dtype_categories
75
from ._flags import get_array_api_strict_flags

array_api_strict/_indexing_functions.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import numpy as np
42

53
from ._array_object import Array

array_api_strict/_info.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import numpy as np
42

53
from . import _dtypes as dt

array_api_strict/_linalg.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from collections.abc import Sequence
42
from functools import partial
53
from typing import Literal, NamedTuple

array_api_strict/_linear_algebra_functions.py

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
linalg extension is disabled in the flags.
55
66
"""
7-
8-
from __future__ import annotations
9-
107
from collections.abc import Sequence
118

129
import numpy as np

array_api_strict/_manipulation_functions.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import numpy as np
42

53
from ._array_object import Array

array_api_strict/_searching_functions.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Literal
42

53
import numpy as np

array_api_strict/_set_functions.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import NamedTuple
42

53
import numpy as np

array_api_strict/_sorting_functions.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Literal
42

53
import numpy as np

array_api_strict/_statistical_functions.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Any
42

53
import numpy as np

array_api_strict/_utility_functions.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Any
42

53
import numpy as np

pyproject.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "array_api_strict"
77
dynamic = ["version"]
8-
requires-python = ">= 3.9"
8+
requires-python = ">= 3.10"
99
dependencies = ["numpy"]
1010
license = {file = "LICENSE"}
1111
authors = [
@@ -15,7 +15,6 @@ description = "A strict, minimal implementation of the Python array API standard
1515
readme = "README.md"
1616
classifiers = [
1717
"Programming Language :: Python :: 3",
18-
"Programming Language :: Python :: 3.9",
1918
"Programming Language :: Python :: 3.10",
2019
"Programming Language :: Python :: 3.11",
2120
"Programming Language :: Python :: 3.12",
@@ -24,7 +23,7 @@ classifiers = [
2423
"Operating System :: OS Independent",
2524
]
2625

27-
[project-urls]
26+
[project.urls]
2827
Homepage = "https://data-apis.org/array-api-strict/"
2928
Repository = "https://github.com/data-apis/array-api-strict"
3029

0 commit comments

Comments
 (0)