From 7d7a2d67f3d1f97e1ba62c05e4b5940413a1517d Mon Sep 17 00:00:00 2001 From: "Jason Parham, Ph.D." Date: Mon, 2 Feb 2026 23:22:26 -0500 Subject: [PATCH 1/2] Explicit Numpy 2.0 ABI (#1) * Explicit Numpy 2.0 ABI * Skip building for Python 3.8 * Small changes * Disable Windows Arm * Bump macros, Python requires, and pyastar2d version * Bump deprecated API to Numpy 2.0 --- .github/workflows/python-publish.yml | 2 +- pyproject.toml | 2 +- setup.py | 9 +++++---- src/cpp/astar.cpp | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index af9d11b..44a7bfa 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -50,7 +50,7 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v3.3.0 env: - CIBW_SKIP: "cp314t-*" + CIBW_SKIP: "cp38-* cp314t-*" - uses: actions/upload-artifact@v6 with: diff --git a/pyproject.toml b/pyproject.toml index 9ee21c9..efe2bb5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools>=64", "wheel", "numpy"] +requires = ["setuptools>=64", "wheel", "numpy>=2.0.0"] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 2a510fd..e161b72 100644 --- a/setup.py +++ b/setup.py @@ -27,8 +27,9 @@ def __str__(self): 'src/cpp/experimental_heuristics.cpp', ], define_macros=[ - ('Py_LIMITED_API', '0x03080000'), - ('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION'), + ('Py_LIMITED_API', '0x03090000'), + ('NPY_NO_DEPRECATED_API', 'NPY_2_0_API_VERSION'), + ('NPY_TARGET_VERSION', 'NPY_2_0_API_VERSION'), ], py_limited_api=True, include_dirs=[ @@ -42,7 +43,7 @@ def __str__(self): # Define package metadata setup( name='pyastar2d', - version='1.1.0', + version='1.1.1', author='Hendrik Weideman', author_email='hjweide@gmail.com', description='A simple implementation of the A* algorithm for path-finding on a two-dimensional grid.', @@ -52,7 +53,7 @@ def __str__(self): packages=find_packages(where='src', exclude=('tests',)), package_dir={'': 'src'}, install_requires=install_requires, - python_requires='>=3.8', + python_requires='>=3.9', ext_modules=[astar_module], options={'bdist_wheel': {'py_limited_api': 'cp38'}}, ) diff --git a/src/cpp/astar.cpp b/src/cpp/astar.cpp index 1757202..b15dc03 100644 --- a/src/cpp/astar.cpp +++ b/src/cpp/astar.cpp @@ -2,7 +2,8 @@ #include #include #include -#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION +#define NPY_NO_DEPRECATED_API NPY_2_0_API_VERSION +#define NPY_TARGET_VERSION NPY_2_0_API_VERSION #include #include #include From e62350ce86dfaf0d3b3ce7506988cf7556f00f6f Mon Sep 17 00:00:00 2001 From: Jason Parham Date: Thu, 5 Feb 2026 00:46:05 -0500 Subject: [PATCH 2/2] Updates based on code review --- requirements.txt | 2 +- setup.py | 2 +- src/cpp/astar.cpp | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index 3a353ed..784c98d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ imageio -numpy +numpy>=2.0.0 diff --git a/setup.py b/setup.py index e161b72..f0621a5 100644 --- a/setup.py +++ b/setup.py @@ -55,5 +55,5 @@ def __str__(self): install_requires=install_requires, python_requires='>=3.9', ext_modules=[astar_module], - options={'bdist_wheel': {'py_limited_api': 'cp38'}}, + options={'bdist_wheel': {'py_limited_api': 'cp39'}}, ) diff --git a/src/cpp/astar.cpp b/src/cpp/astar.cpp index b15dc03..a2133b9 100644 --- a/src/cpp/astar.cpp +++ b/src/cpp/astar.cpp @@ -2,8 +2,6 @@ #include #include #include -#define NPY_NO_DEPRECATED_API NPY_2_0_API_VERSION -#define NPY_TARGET_VERSION NPY_2_0_API_VERSION #include #include #include