Skip to content

Commit 8d588db

Browse files
authored
chore: SPEC0 update (Python 3.12+) (#140)
1 parent da8e85a commit 8d588db

File tree

26 files changed

+112
-134
lines changed

26 files changed

+112
-134
lines changed

.github/workflows/ci-gpu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ jobs:
4343
- uses: actions/setup-python@v5
4444
with:
4545
python-version: "3.12"
46-
- uses: hynek/setup-cached-uv@v2
46+
- uses: astral-sh/setup-uv@v6
4747
with:
48-
cache-dependency-path: pyproject.toml
48+
enable-cache: true # "auto" is `false` on non-GitHub runners
4949
- name: Install package
5050
run: uv pip install --system -e .[test,full] cupy-cuda12x --extra-index-url=https://pypi.nvidia.com --index-strategy=unsafe-best-match
5151
- name: List installed packages

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
steps:
7676
- uses: actions/checkout@v5
7777
with: { fetch-depth: 0, filter: "blob:none" }
78-
- uses: actions/setup-python@v5
78+
- uses: actions/setup-python@v6
7979
with:
8080
python-version: '3.13'
8181
- uses: astral-sh/setup-uv@v7
@@ -90,7 +90,7 @@ jobs:
9090
steps:
9191
- uses: actions/checkout@v5
9292
with: { fetch-depth: 0, filter: "blob:none" }
93-
- uses: actions/setup-python@v5
93+
- uses: actions/setup-python@v6
9494
with:
9595
python-version: '3.13'
9696
- uses: astral-sh/setup-uv@v7
@@ -110,7 +110,7 @@ jobs:
110110
steps:
111111
- uses: actions/checkout@v5
112112
with: { fetch-depth: 0, filter: "blob:none" }
113-
- uses: actions/setup-python@v5
113+
- uses: actions/setup-python@v6
114114
with:
115115
python-version: ${{ matrix.python-version }}
116116
- uses: pre-commit/[email protected]

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
permissions:
1414
id-token: write # to authenticate as Trusted Publisher to pypi.org
1515
steps:
16-
- uses: actions/checkout@v4
17-
- uses: actions/setup-python@v5
16+
- uses: actions/checkout@v5
17+
- uses: actions/setup-python@v6
1818
with:
1919
python-version: "3.x"
2020
cache: pip

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
build:
33
os: ubuntu-24.04
44
tools:
5-
python: "3.12"
5+
python: "3.13"
66
python:
77
install:
88
- method: pip

docs/conf.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,20 @@
99
from typing import TYPE_CHECKING
1010

1111
from docutils.nodes import Text
12+
from sphinx.util import logging
1213

1314

1415
if TYPE_CHECKING:
16+
from typing import Final
17+
1518
from docutils.nodes import TextElement, reference
1619
from sphinx.addnodes import pending_xref
1720
from sphinx.application import Sphinx
1821
from sphinx.environment import BuildEnvironment
1922

2023

21-
HERE = Path(__file__).parent
24+
HERE: Final = Path(__file__).parent
25+
LOGGER: Final = logging.getLogger("fast_array_utils")
2226

2327

2428
# -- General configuration ------------------------------------------------
@@ -134,7 +138,8 @@ def resolve_type_aliases(app: Sphinx, env: BuildEnvironment, node: pending_xref,
134138
ref = resolve_reference_any_inventory(env=env, honor_disabled_refs=False, node=node, contnode=contnode)
135139
if ref is None:
136140
msg = f"Could not resolve {typ} {target} (from {node['reftarget']})"
137-
raise AssertionError(msg)
141+
LOGGER.warning(msg, type="ref")
142+
return ref
138143
if name:
139144
ref.children[:] = [Text(name)]
140145
return ref

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ license = "MPL-2.0"
1414
authors = [
1515
{ name = "Philipp A.", email = "[email protected]" },
1616
]
17-
requires-python = ">=3.11"
17+
requires-python = ">=3.12"
1818
classifiers = [
1919
"Development Status :: 5 - Production/Stable",
2020
"Intended Audience :: Developers",
2121
"Programming Language :: Python :: 3 :: Only",
22-
"Programming Language :: Python :: 3.11",
2322
"Programming Language :: Python :: 3.12",
2423
"Programming Language :: Python :: 3.13",
2524
"Programming Language :: Python :: 3.14",
@@ -107,11 +106,11 @@ overrides.matrix.resolution.dependencies = [
107106
]
108107

109108
[[tool.hatch.envs.hatch-test.matrix]]
110-
python = [ "3.13", "3.11" ]
109+
python = [ "3.13", "3.12" ]
111110
extras = [ "full", "min" ]
112111

113112
[[tool.hatch.envs.hatch-test.matrix]]
114-
python = [ "3.11" ]
113+
python = [ "3.12" ]
115114
extras = [ "full" ]
116115
resolution = [ "lowest" ]
117116

src/fast_array_utils/conv/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from typing import TYPE_CHECKING, overload
77

8-
from ..typing import CpuArray, DiskArray, GpuArray # noqa: TC001
98
from ._to_dense import to_dense_
109

1110

@@ -15,6 +14,7 @@
1514
from numpy.typing import NDArray
1615

1716
from .. import types
17+
from ..typing import CpuArray, DiskArray, GpuArray
1818

1919

2020
__all__ = ["to_dense"]

src/fast_array_utils/conv/_to_dense.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
import numpy as np
99

1010
from .. import types
11-
from ..typing import CpuArray, DiskArray, GpuArray # noqa: TC001
1211

1312

1413
if TYPE_CHECKING:
1514
from typing import Any, Literal
1615

1716
from numpy.typing import NDArray
1817

18+
from ..typing import CpuArray, DiskArray, GpuArray
19+
1920

2021
# fallback’s arg0 type has to include types of registered functions
2122
@singledispatch

src/fast_array_utils/stats/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from typing import TYPE_CHECKING, cast, get_args, overload
1111

1212
from .._validation import validate_axis
13-
from ..typing import CpuArray, DiskArray, GpuArray # noqa: TC001
1413
from ._generic_ops import DtypeOps
1514

1615

@@ -22,6 +21,7 @@
2221
from optype.numpy import ToDType
2322

2423
from .. import types
24+
from ..typing import CpuArray, DiskArray, GpuArray
2525
from ._generic_ops import Ops
2626
from ._typing import NoDtypeOps, StatFunDtype, StatFunNoDtype
2727

src/fast_array_utils/stats/_generic_ops.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313

1414
if TYPE_CHECKING:
15-
from typing import Any, Literal, TypeAlias
15+
from typing import Any, Literal
1616

1717
from numpy.typing import DTypeLike, NDArray
1818

1919
from ..typing import CpuArray, DiskArray, GpuArray
2020
from ._typing import Ops
2121

22-
ComplexAxis: TypeAlias = tuple[Literal[0], Literal[1]] | tuple[Literal[0, 1]] | Literal[0, 1] | None
22+
type ComplexAxis = tuple[Literal[0], Literal[1]] | tuple[Literal[0, 1]] | Literal[0, 1] | None
2323

2424

2525
def _run_numpy_op(

0 commit comments

Comments
 (0)