From 0740e3e68adddb2854d2538333e7b17a32733907 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 5 Jan 2026 11:05:00 -0500 Subject: [PATCH 1/5] test py3.14 --- .github/workflows/ci.yml | 2 +- pyproject.toml | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60a938110..37e1769f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] platform: [ubuntu-latest, macos-latest, windows-latest] steps: diff --git a/pyproject.toml b/pyproject.toml index 5cb275034..ebb7b7e3b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] dynamic = ["version"] dependencies = ["numpy"] @@ -150,10 +151,8 @@ filterwarnings = [ "ignore::DeprecationWarning:Pyinstaller", "ignore::DeprecationWarning:pkg_resources", "ignore::DeprecationWarning:altgraph", - "ignore:'oneOf' deprecated:DeprecationWarning:matplotlib", - "ignore:'parseString' deprecated:DeprecationWarning:matplotlib", - "ignore:'resetCache' deprecated:DeprecationWarning:matplotlib", - "ignore:'enablePackrat' deprecated:DeprecationWarning:matplotlib", + "ignore::DeprecationWarning:matplotlib._mathtext", + "ignore::DeprecationWarning:matplotlib._fontconfig_pattern", ] # https://mypy.readthedocs.io/en/stable/config_file.html From 282a8506cac3a9759266bb97414c231d17fa70b5 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 5 Jan 2026 11:10:06 -0500 Subject: [PATCH 2/5] add ignore --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index ebb7b7e3b..01539c812 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -151,6 +151,7 @@ filterwarnings = [ "ignore::DeprecationWarning:Pyinstaller", "ignore::DeprecationWarning:pkg_resources", "ignore::DeprecationWarning:altgraph", + "ignore::DeprecationWarning:pyparsing", "ignore::DeprecationWarning:matplotlib._mathtext", "ignore::DeprecationWarning:matplotlib._fontconfig_pattern", ] From 60785c3b00bb5f3a46608f7081b9ad1917e0c9c8 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 5 Jan 2026 11:30:24 -0500 Subject: [PATCH 3/5] no napari in 314 --- pyproject.toml | 2 +- src/cmap/_color.py | 2 +- src/cmap/_colormap.py | 4 ++-- src/cmap/data/glasbey/_glasbey.py | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 01539c812..9bf16b37b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ test_thirdparty = [ "colorspacious", "colour", "matplotlib", - "napari>=0.5.0", + "napari>=0.5.0; python_version<'3.14'", "PyQt6==6.8.1", "numba", "numba<0.61; python_version<'3.12'", diff --git a/src/cmap/_color.py b/src/cmap/_color.py index 56cde019b..4eb3b2a17 100644 --- a/src/cmap/_color.py +++ b/src/cmap/_color.py @@ -603,7 +603,7 @@ def __getitem__(self, key: int) -> float: def __iter__(self) -> Iterator[float]: return iter(self._rgba) - def __array__(self, dtype: npt.DTypeLike = None) -> np.ndarray: + def __array__(self, dtype: npt.DTypeLike | None = None) -> np.ndarray: return np.asarray(self._rgba, dtype=dtype) @property diff --git a/src/cmap/_colormap.py b/src/cmap/_colormap.py index ba4712891..3f2127ccd 100644 --- a/src/cmap/_colormap.py +++ b/src/cmap/_colormap.py @@ -1006,7 +1006,7 @@ def __reversed__(self) -> Iterator[ColorStop]: # reverse the colors, but not the positions yield ColorStop(1 - pos, Color(rgba)) - def __array__(self, dtype: npt.DTypeLike = None) -> np.ndarray: + def __array__(self, dtype: npt.DTypeLike | None = None) -> np.ndarray: """Return (N, 5) array, N rows of (position, r, g, b, a).""" return self._stops if dtype is None else self._stops.astype(dtype) @@ -1523,4 +1523,4 @@ def _wrap_shift_color_stops(data: np.ndarray, shift_amount: float) -> np.ndarray out[:, 0] %= 1 # sort the array by the first column out = out[out[:, 0].argsort()] - return out # type: ignore[no-any-return] + return out # type: ignore \ No newline at end of file diff --git a/src/cmap/data/glasbey/_glasbey.py b/src/cmap/data/glasbey/_glasbey.py index 2eef99f13..f8adfd389 100644 --- a/src/cmap/data/glasbey/_glasbey.py +++ b/src/cmap/data/glasbey/_glasbey.py @@ -2,7 +2,7 @@ # see __init__ and LICENSE_GLASBEY from __future__ import annotations -from typing import Literal +from typing import Literal, cast import numpy as np @@ -185,4 +185,5 @@ def create_palette( def _get_rgb_palette(cam02ucs_palette: np.ndarray) -> np.ndarray: raw_rgb_palette = _cspace_convert(cam02ucs_palette, "CAM02-UCS", "sRGB1") - return np.clip(raw_rgb_palette, 0.0, 1.0) + out = np.clip(raw_rgb_palette, 0.0, 1.0) + return cast("np.ndarray", out) From b1884ab87b606644d29388ab9727a4cd89b590c2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Jan 2026 16:32:48 +0000 Subject: [PATCH 4/5] style(pre-commit.ci): auto fixes [...] --- src/cmap/_colormap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmap/_colormap.py b/src/cmap/_colormap.py index 3f2127ccd..f23b41619 100644 --- a/src/cmap/_colormap.py +++ b/src/cmap/_colormap.py @@ -1523,4 +1523,4 @@ def _wrap_shift_color_stops(data: np.ndarray, shift_amount: float) -> np.ndarray out[:, 0] %= 1 # sort the array by the first column out = out[out[:, 0].argsort()] - return out # type: ignore \ No newline at end of file + return out # type: ignore From 695b8be4ecf6978474b0d59edc713df82a99c085 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 5 Jan 2026 11:43:49 -0500 Subject: [PATCH 5/5] try fix precommit --- .pre-commit-config.yaml | 2 +- src/cmap/_colormap.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8186ce787..f53e20a3b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,4 +34,4 @@ repos: - id: mypy files: "^src/" additional_dependencies: - - numpy>=2.2 + - numpy>=2.4.0 diff --git a/src/cmap/_colormap.py b/src/cmap/_colormap.py index f23b41619..748742ddc 100644 --- a/src/cmap/_colormap.py +++ b/src/cmap/_colormap.py @@ -1522,5 +1522,4 @@ def _wrap_shift_color_stops(data: np.ndarray, shift_amount: float) -> np.ndarray out[:, 0] += shift_amount out[:, 0] %= 1 # sort the array by the first column - out = out[out[:, 0].argsort()] - return out # type: ignore + return out[out[:, 0].argsort()]