Skip to content

Commit 536b052

Browse files
committed
DEP: drop support for CPython 3.10 and numpy<1.25
1 parent afc46b8 commit 536b052

File tree

5 files changed

+8
-77
lines changed

5 files changed

+8
-77
lines changed

pyproject.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ classifiers = [
1919
"Programming Language :: Cython",
2020
"Programming Language :: Python :: 3",
2121
]
22-
requires-python = ">=3.10"
22+
requires-python = ">=3.11"
2323
dependencies = [
2424
# keep in sync with NPY_TARGET_VERSION (setup.py)
25-
# https://github.com/scipy/oldest-supported-numpy/issues/76#issuecomment-1628865694
26-
"numpy>=1.23, <3",
27-
"typing-extensions>=4.1.0 ; python_version < '3.11'",
25+
"numpy>=1.25, <3",
2826
]
2927

3028
[project.readme]
@@ -103,7 +101,7 @@ convention = "numpy"
103101
"_backports.py" = ["D"]
104102

105103
[tool.mypy]
106-
python_version = "3.10"
104+
python_version = "3.11"
107105
show_error_codes = true
108106
pretty = true
109107
warn_return_any = true
@@ -124,7 +122,7 @@ filterwarnings = [
124122
]
125123

126124
[tool.cibuildwheel]
127-
build = "cp310-* cp311-* cp312-*"
125+
build = "cp311-* cp312-*"
128126
build-frontend = "build[uv]"
129127
build-verbosity = 1
130128
test-skip = "*-musllinux*"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
include_dirs=[np.get_include()],
2929
define_macros=[
3030
# keep in sync with runtime requirements (pyproject.toml)
31-
("NPY_TARGET_VERSION", "NPY_1_23_API_VERSION"),
31+
("NPY_TARGET_VERSION", "NPY_1_25_API_VERSION"),
3232
("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"),
3333
],
3434
)

src/gpgi/_backports.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/gpgi/_typing.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
import sys
2-
from typing import TypedDict, TypeVar
1+
from typing import NotRequired, TypedDict, TypeVar
32

43
import numpy as np
54
import numpy.typing as npt
65

7-
if sys.version_info >= (3, 11):
8-
from typing import NotRequired
9-
else:
10-
from typing_extensions import NotRequired
11-
126
Real = TypeVar("Real", np.float32, np.float64)
137
RealArray = npt.NDArray[Real]
148
HCIArray = npt.NDArray[np.uint16]

src/gpgi/types.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
import enum
66
import math
7-
import sys
87
import warnings
98
from abc import ABC, abstractmethod
109
from copy import deepcopy
10+
from enum import StrEnum
1111
from functools import cached_property, partial, reduce
1212
from itertools import chain
1313
from textwrap import indent
1414
from time import monotonic_ns
15-
from typing import TYPE_CHECKING, Any, Literal, Protocol, cast
15+
from typing import TYPE_CHECKING, Any, Literal, Protocol, Self, assert_never, cast
1616

1717
import numpy as np
1818

@@ -31,15 +31,6 @@
3131
)
3232
from ._typing import FieldMap, Name
3333

34-
if sys.version_info >= (3, 11):
35-
from enum import StrEnum
36-
from typing import Self, assert_never
37-
else:
38-
from typing_extensions import Self, assert_never
39-
40-
from ._backports import StrEnum
41-
42-
4334
if TYPE_CHECKING:
4435
from ._typing import HCIArray, RealArray
4536

@@ -53,14 +44,6 @@ class Geometry(StrEnum):
5344
SPHERICAL = enum.auto()
5445
EQUATORIAL = enum.auto()
5546

56-
if sys.version_info >= (3, 11):
57-
pass
58-
else:
59-
60-
def __str__(self) -> str:
61-
r"""Return str(self)."""
62-
return self.name.lower()
63-
6447

6548
class DepositionMethod(enum.Enum):
6649
NEAREST_GRID_POINT = enum.auto()

0 commit comments

Comments
 (0)