Repository: Kramer84/pyfqmr-Fast-Quadric-Mesh-Reduction (language: python)

Issue:
Upgrade numpy from 1.26.4 to 2.0.1
Thank you very much for your work. It is very useful. 

I have tried to update numpy to version 2.0.1. When doing so, pyfqmr gives the following error. 

` 
Python 3.11.9 (main, Aug  2 2024, 14:42:39) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyfqmr
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.11/site-packages/pyfqmr/__init__.py", line 1, in <module>
    from .Simplify import *
  File "pyfqmr/Simplify.pyx", line 1, in init pyfqmr.Simplify
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
`

Are there any plans to release a new version of pyfqmr that will make it work?


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml
index e5d6042..2d830fb 100644
--- a/.github/workflows/build-wheels.yml
+++ b/.github/workflows/build-wheels.yml
@@ -19,7 +19,7 @@ jobs:
       - uses: actions/setup-python@v3
 
       - name: Install cibuildwheel
-        run: python -m pip install cibuildwheel==2.16.2
+        run: python -m pip install cibuildwheel
 
       # We need docker's cross architecture emulation to build ARM wheels.
       - if: startsWith(matrix.os, 'ubuntu')
diff --git a/VERSION b/VERSION
index 0ea3a94..0c62199 100644
--- a/VERSION
+++ b/VERSION
@@ -1,1 +1,1 @@
-0.2.0
+0.2.1
diff --git a/pyproject.toml b/pyproject.toml
index e5649e1..c906d59 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -3,5 +3,8 @@ requires = [
   "setuptools",
   "wheel",
   "cython",
-  "oldest-supported-numpy",
+  # NumPy must be locked in order to support 1.x and 2.x
+  "numpy==2.0; python_version >= '3.9'",
+  # Unless building for a Python version that NumPy 2.x doesn't support
+  "oldest-supported-numpy; python_version <= '3.8'",
 ]


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index de00a3f..d2cce33 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -11,7 +11,7 @@ jobs:
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
-        os: [ubuntu-latest, macos-latest, windows-latest]
+        os: [ubuntu-latest, macos-13, windows-latest]
         python-version: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12]
       fail-fast: false
 
@@ -31,3 +31,7 @@ jobs:
 
       # Test
       - run: pytest
+
+      # Test again with oldest NumPy for ABI incompatibilities
+      - run: pip install --force-reinstall oldest-supported-numpy trimesh
+      - run: pytest